[Python-checkins] CVS: python/dist/src/Lib sre_parse.py,1.34,1.35

Fredrik Lundh python-dev@python.org
Tue, 3 Oct 2000 12:22:29 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory slayer.i.sourceforge.net:/tmp/cvs-serv3131/Lib

Modified Files:
	sre_parse.py 
Log Message:


Recompile pattern if (?x) flag was found inside the pattern during the
first scan.  Closes bug #115040.


Index: sre_parse.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/sre_parse.py,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -r1.34 -r1.35
*** sre_parse.py	2000/09/24 14:46:19	1.34
--- sre_parse.py	2000/10/03 19:22:26	1.35
***************
*** 594,597 ****
--- 594,602 ----
      # p.dump()
  
+     if not (flags & SRE_FLAG_VERBOSE) and p.pattern.flags & SRE_FLAG_VERBOSE:
+         # the VERBOSE flag was switched on inside the pattern.  to be
+         # on the safe side, we'll parse the whole thing again...
+         return parse(str, p.pattern.flags)
+ 
      return p