From: Fredrik Lundh Date: Fri, 15 Oct 2004 06:15:08 +0000 (+0000) Subject: make sure to check for this limit even if we're running with -O X-Git-Tag: v2.4b1~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5e7d51b62cc86314987b833a2a800b9528e906d7;p=thirdparty%2FPython%2Fcpython.git make sure to check for this limit even if we're running with -O --- diff --git a/Lib/sre_compile.py b/Lib/sre_compile.py index fa21d95f5685..27ab1fe7482a 100644 --- a/Lib/sre_compile.py +++ b/Lib/sre_compile.py @@ -502,8 +502,10 @@ def compile(p, flags=0): # print code # XXX: 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