mirror of
https://github.com/python/cpython.git
synced 2025-08-01 15:43:13 +00:00
- Issue #3629: Fix sre "bytecode" validator for an end case.
Reviewed by Amaury.
This commit is contained in:
parent
24329ba176
commit
e3c4fd9cc0
3 changed files with 10 additions and 3 deletions
|
@ -116,6 +116,10 @@ class ReTests(unittest.TestCase):
|
|||
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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue