[Python-checkins] python/dist/src/Lib sre_compile.py,1.55,1.56

effbot at users.sourceforge.net effbot at users.sourceforge.net
Fri Oct 15 08:15:11 CEST 2004


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22522/Lib

Modified Files:
	sre_compile.py 
Log Message:
make sure to check for this limit even if we're running with -O



Index: sre_compile.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/sre_compile.py,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- sre_compile.py	7 May 2004 07:18:12 -0000	1.55
+++ sre_compile.py	15 Oct 2004 06:15:08 -0000	1.56
@@ -502,8 +502,10 @@
     # 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



More information about the Python-checkins mailing list