mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Issue #17998: Fix an internal error in regular expression engine.
This commit is contained in:
parent
1dfb9180a7
commit
1f35ae0a3c
4 changed files with 19 additions and 7 deletions
|
@ -1040,6 +1040,16 @@ class ReTests(unittest.TestCase):
|
|||
with self.assertRaisesRegex(sre_constants.error, '\?foo'):
|
||||
re.compile('(?P<?foo>)')
|
||||
|
||||
def test_issue17998(self):
|
||||
for reps in '*', '+', '?', '{1}':
|
||||
for mod in '', '?':
|
||||
pattern = '.' + reps + mod + 'yz'
|
||||
self.assertEqual(re.compile(pattern, re.S).findall('xyz'),
|
||||
['xyz'], msg=pattern)
|
||||
pattern = pattern.encode()
|
||||
self.assertEqual(re.compile(pattern, re.S).findall(b'xyz'),
|
||||
[b'xyz'], msg=pattern)
|
||||
|
||||
|
||||
def run_re_tests():
|
||||
from test.re_tests import tests, SUCCEED, FAIL, SYNTAX_ERROR
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue