[Python-checkins] CVS: python/dist/src/Lib sre_compile.py,1.30,1.31 sre_constants.py,1.20,1.21 sre_parse.py,1.36,1.37
Fredrik Lundh
python-dev@python.org
Sat, 7 Oct 2000 10:38:26 -0700
Update of /cvsroot/python/python/dist/src/Lib
In directory slayer.i.sourceforge.net:/tmp/cvs-serv2906/Lib
Modified Files:
sre_compile.py sre_constants.py sre_parse.py
Log Message:
Fixed too ambitious "nothing to repeat" check. Closes bug #114033.
Index: sre_compile.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/sre_compile.py,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -r1.30 -r1.31
*** sre_compile.py 2000/08/07 20:59:04 1.30
--- sre_compile.py 2000/10/07 17:38:22 1.31
***************
*** 223,227 ****
# check if av is a "simple" operator
lo, hi = av[2].getwidth()
! if lo == 0:
raise error, "nothing to repeat"
return lo == hi == 1 and av[2][0][0] != SUBPATTERN
--- 223,227 ----
# check if av is a "simple" operator
lo, hi = av[2].getwidth()
! if lo == 0 and hi == MAXREPEAT:
raise error, "nothing to repeat"
return lo == hi == 1 and av[2][0][0] != SUBPATTERN
Index: sre_constants.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/sre_constants.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** sre_constants.py 2000/08/01 22:47:48 1.20
--- sre_constants.py 2000/10/07 17:38:22 1.21
***************
*** 10,13 ****
--- 10,15 ----
#
+ MAXREPEAT = 65535
+
# should this really be here?
Index: sre_parse.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/sre_parse.py,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -r1.36 -r1.37
*** sre_parse.py 2000/10/07 10:16:14 1.36
--- sre_parse.py 2000/10/07 17:38:22 1.37
***************
*** 13,18 ****
from sre_constants import *
- MAXREPEAT = 65535
-
SPECIAL_CHARS = ".\\[{()*+?^$|"
REPEAT_CHARS = "*+?{"
--- 13,16 ----