Merged revisions 66364 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r66364 | guido.van.rossum | 2008-09-10 07:27:00 -0700 (Wed, 10 Sep 2008) | 3 lines
Issue #3629: Fix sre "bytecode" validator for an end case.
Reviewed by Amaury.
........
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
index 6ee84c6..8229d4a 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -91,6 +91,10 @@
self.assertRaises(ValueError, re.findall, pattern, 'A', re.I)
self.assertRaises(ValueError, re.compile, pattern, re.I)
+ def test_bug_3629(self):
+ # A regex that triggered a bug in the sre-code validator
+ re.compile("(?P<quote>)(?(quote))")
+
def test_sub_template_numeric_escape(self):
# bug 776311 and friends
self.assertEqual(re.sub('x', r'\0', 'x'), '\0')