From: Guido van Rossum Date: Tue, 5 Feb 2008 17:27:23 +0000 (+0000) Subject: In the experimental 'Scanner' feature, the group count was set wrong. X-Git-Tag: v2.5.2c1~26 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9decb7034973a5ed7587c797e8c8e893e92a0460;p=python In the experimental 'Scanner' feature, the group count was set wrong. --- diff --git a/Lib/re.py b/Lib/re.py index a33e34e4e1..90956f34e2 100644 --- a/Lib/re.py +++ b/Lib/re.py @@ -290,8 +290,8 @@ class Scanner: 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 = []