[Python-checkins] r60594 - python/branches/release25-maint/Lib/re.py

guido.van.rossum python-checkins at python.org
Tue Feb 5 18:27:23 CET 2008


Author: guido.van.rossum
Date: Tue Feb  5 18:27:23 2008
New Revision: 60594

Modified:
   python/branches/release25-maint/Lib/re.py
Log:
In the experimental 'Scanner' feature, the group count was set wrong.


Modified: python/branches/release25-maint/Lib/re.py
==============================================================================
--- python/branches/release25-maint/Lib/re.py	(original)
+++ python/branches/release25-maint/Lib/re.py	Tue Feb  5 18:27:23 2008
@@ -290,8 +290,8 @@
             p.append(sre_parse.SubPattern(s, [
                 (SUBPATTERN, (len(p)+1, sre_parse.parse(phrase, flags))),
                 ]))
+        s.groups = len(p)+1
         p = sre_parse.SubPattern(s, [(BRANCH, (None, p))])
-        s.groups = len(p)
         self.scanner = sre_compile.compile(p)
     def scan(self, string):
         result = []


More information about the Python-checkins mailing list