make sure to check for this limit even if we're running with -O

This commit is contained in:
Fredrik Lundh 2004-10-15 06:15:08 +00:00
parent d37ddeba4c
commit 5e7d51b62c

View file

@ -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