[Python-checkins] python/dist/src/Lib sre_parse.py,1.64,1.65

niemeyer@users.sourceforge.net niemeyer at users.sourceforge.net
Wed Sep 14 10:54:42 CEST 2005


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

Modified Files:
	sre_parse.py 
Log Message:
Bug #1202493: Fixing SRE parser to handle '{}' as perl does, rather than
considering it exactly like a '*'.


Index: sre_parse.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/sre_parse.py,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -d -r1.64 -r1.65
--- sre_parse.py	28 Feb 2005 19:27:52 -0000	1.64
+++ sre_parse.py	14 Sep 2005 08:54:39 -0000	1.65
@@ -485,6 +485,9 @@
             elif this == "+":
                 min, max = 1, MAXREPEAT
             elif this == "{":
+                if source.next == "}":
+                    subpatternappend((LITERAL, ord(this)))
+                    continue
                 here = source.tell()
                 min, max = 0, MAXREPEAT
                 lo = hi = ""



More information about the Python-checkins mailing list