mirror of
https://github.com/python/cpython.git
synced 2025-12-02 07:37:25 +00:00
make sure to check for this limit even if we're running with -O
This commit is contained in:
parent
d37ddeba4c
commit
5e7d51b62c
1 changed files with 4 additions and 2 deletions
|
|
@ -502,8 +502,10 @@ def compile(p, flags=0):
|
||||||
# print code
|
# print code
|
||||||
|
|
||||||
# XXX: <fl> get rid of this limitation!
|
# XXX: <fl> get rid of this limitation!
|
||||||
assert p.pattern.groups <= 100,\
|
if p.pattern.groups > 100:
|
||||||
|
raise AssertionError(
|
||||||
"sorry, but this version only supports 100 named groups"
|
"sorry, but this version only supports 100 named groups"
|
||||||
|
)
|
||||||
|
|
||||||
# map in either direction
|
# map in either direction
|
||||||
groupindex = p.pattern.groupdict
|
groupindex = p.pattern.groupdict
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue