summaryrefslogtreecommitdiff
path: root/dev-python/smartypants/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-10-20 15:52:41 +0100
committerV3n3RiX <venerix@koprulu.sector>2023-10-20 15:52:41 +0100
commitb3830a745865c7d85daf3317603ad23dac6434da (patch)
tree8bacb840498f00754dc51ec2ab76bb175f52fc58 /dev-python/smartypants/files
parent547caa904733bc2a3ac112415990a114ecbe8824 (diff)
gentoo auto-resync : 20:10:2023 - 15:52:41
Diffstat (limited to 'dev-python/smartypants/files')
-rw-r--r--dev-python/smartypants/files/smartypants-2.0.1-py312.patch110
1 files changed, 110 insertions, 0 deletions
diff --git a/dev-python/smartypants/files/smartypants-2.0.1-py312.patch b/dev-python/smartypants/files/smartypants-2.0.1-py312.patch
new file mode 100644
index 000000000000..e1e3a1ac6249
--- /dev/null
+++ b/dev-python/smartypants/files/smartypants-2.0.1-py312.patch
@@ -0,0 +1,110 @@
+From ea46bf36343044a7a61ba3acce4a7f188d986ec5 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ond=C5=99ej=20S=C3=BAkup?= <mimi.vx@gmail.com>
+Date: Mon, 25 Sep 2023 10:31:37 +0200
+Subject: [PATCH] Fix regexps and tests for python3.12
+
+---
+ smartypants.py | 4 ++--
+ tests/test.py | 4 ++--
+ tests/test_cli.py | 16 ++++++++--------
+ 3 files changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/smartypants.py b/smartypants.py
+index c39f409..37368fb 100755
+--- a/smartypants.py
++++ b/smartypants.py
+@@ -268,13 +268,13 @@ def smartypants(text, attr=None):
+ if do_quotes:
+ if t == "'":
+ # Special case: single-character ' token
+- if re.match("\S", prev_token_last_char):
++ if re.match(r"\S", prev_token_last_char):
+ t = "&#8217;"
+ else:
+ t = "&#8216;"
+ elif t == '"':
+ # Special case: single-character " token
+- if re.match("\S", prev_token_last_char):
++ if re.match(r"\S", prev_token_last_char):
+ t = "&#8221;"
+ else:
+ t = "&#8220;"
+diff --git a/tests/test.py b/tests/test.py
+index 2c1a0ea..ac5075a 100644
+--- a/tests/test.py
++++ b/tests/test.py
+@@ -24,7 +24,7 @@ def test_change_default_attr(self):
+
+ T = sp(TEXT)
+ E = '&#8220;foo&#8221; -- bar'
+- self.assertEquals(T, E)
++ self.assertEqual(T, E)
+
+ attr = Attr.q | Attr.d
+ Attr.default = attr
+@@ -32,7 +32,7 @@ def test_change_default_attr(self):
+
+ T = sp(TEXT)
+ E = '&#8220;foo&#8221; &#8212; bar'
+- self.assertEquals(T, E)
++ self.assertEqual(T, E)
+
+ def test_dates(self):
+
+diff --git a/tests/test_cli.py b/tests/test_cli.py
+index e85545a..6b5e136 100644
+--- a/tests/test_cli.py
++++ b/tests/test_cli.py
+@@ -34,7 +34,7 @@ def test_pipe(self):
+ E = '&#8220;foobar&#8221;'
+
+ output = self._p([CLI_SCRIPT], T)
+- self.assertEquals(output, E)
++ self.assertEqual(output, E)
+
+ def test_pipe_attr(self):
+
+@@ -42,11 +42,11 @@ def test_pipe_attr(self):
+
+ E = T
+ output = self._p([CLI_SCRIPT, '--attr', '0'], T)
+- self.assertEquals(output, E)
++ self.assertEqual(output, E)
+
+ E = """"foo" &#8220;bar&#8221;"""
+ output = self._p([CLI_SCRIPT, '--attr', 'b'], T)
+- self.assertEquals(output, E)
++ self.assertEqual(output, E)
+
+ def test_skipped_elements(self):
+
+@@ -54,19 +54,19 @@ def test_skipped_elements(self):
+
+ E = '<a>&#8220;foo&#8221;</a> <b>&#8220;bar&#8221;</b>'
+ output = self._p([CLI_SCRIPT], T)
+- self.assertEquals(output, E)
++ self.assertEqual(output, E)
+
+ E = '<a>"foo"</a> <b>&#8220;bar&#8221;</b>'
+ output = self._p([CLI_SCRIPT, '--skip', 'a'], T)
+- self.assertEquals(output, E)
++ self.assertEqual(output, E)
+
+ E = '<a>&#8220;foo&#8221;</a> <b>"bar"</b>'
+ output = self._p([CLI_SCRIPT, '--skip', 'b'], T)
+- self.assertEquals(output, E)
++ self.assertEqual(output, E)
+
+ E = T
+ output = self._p([CLI_SCRIPT, '--skip', 'a,b'], T)
+- self.assertEquals(output, E)
++ self.assertEqual(output, E)
+
+ def test_file(self):
+
+@@ -81,4 +81,4 @@ def test_file(self):
+ output = self._p([CLI_SCRIPT, F])
+ finally:
+ os.remove(F)
+- self.assertEquals(output, E)
++ self.assertEqual(output, E)