mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Issue #28765: _sre.compile() now checks the type of groupindex and indexgroup
groupindex must a dictionary and indexgroup must be a tuple. Previously, indexgroup was a list. Use a tuple to reduce the memory usage.
This commit is contained in:
parent
e3d75c63cd
commit
726a57d45f
5 changed files with 10 additions and 10 deletions
|
@ -1506,7 +1506,7 @@ class ReTests(unittest.TestCase):
|
|||
long_overflow = 2**128
|
||||
self.assertRaises(TypeError, re.finditer, "a", {})
|
||||
with self.assertRaises(OverflowError):
|
||||
_sre.compile("abc", 0, [long_overflow], 0, [], [])
|
||||
_sre.compile("abc", 0, [long_overflow], 0, {}, ())
|
||||
with self.assertRaises(TypeError):
|
||||
_sre.compile({}, 0, [], 0, [], [])
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue