diff options
author | Benjamin Peterson <benjamin@python.org> | 2014-11-30 16:49:00 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2014-11-30 16:49:00 (GMT) |
commit | 66323415c791502aec973cc1b4b755d22b8ba210 (patch) | |
tree | ff131b01925be49052e96df80bf7eac88f7a48c7 /Lib/re.py | |
parent | b7138e24e3359810158a88e285aae6f34e8d4255 (diff) | |
download | cpython-66323415c791502aec973cc1b4b755d22b8ba210.zip cpython-66323415c791502aec973cc1b4b755d22b8ba210.tar.gz cpython-66323415c791502aec973cc1b4b755d22b8ba210.tar.bz2 |
backout 9fcf4008b626 (#9179) for further consideration
Diffstat (limited to 'Lib/re.py')
-rw-r--r-- | Lib/re.py | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -352,11 +352,10 @@ class Scanner: s = sre_parse.Pattern() s.flags = flags for phrase, action in lexicon: - gid = s.opengroup() p.append(sre_parse.SubPattern(s, [ - (SUBPATTERN, (gid, sre_parse.parse(phrase, flags))), + (SUBPATTERN, (len(p)+1, sre_parse.parse(phrase, flags))), ])) - s.closegroup(gid, p[-1]) + s.groups = len(p)+1 p = sre_parse.SubPattern(s, [(BRANCH, (None, p))]) self.scanner = sre_compile.compile(p) def scan(self, string): |