mirror of
https://github.com/python/cpython
synced 2024-07-21 10:15:53 +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
|
@ -502,8 +502,10 @@ def compile(p, flags=0):
|
|||
# print code
|
||||
|
||||
# XXX: <fl> get rid of this limitation!
|
||||
assert p.pattern.groups <= 100,\
|
||||
"sorry, but this version only supports 100 named groups"
|
||||
if p.pattern.groups > 100:
|
||||
raise AssertionError(
|
||||
"sorry, but this version only supports 100 named groups"
|
||||
)
|
||||
|
||||
# map in either direction
|
||||
groupindex = p.pattern.groupdict
|
||||
|
|
Loading…
Reference in a new issue