diff options
author | Fredrik Lundh <fredrik@pythonware.com> | 2000-07-02 22:59:57 +0000 |
---|---|---|
committer | Fredrik Lundh <fredrik@pythonware.com> | 2000-07-02 22:59:57 +0000 |
commit | 019bcb598d9b4890a105a0476b9b4e5cb9f14da7 (patch) | |
tree | a039f9d7bd3568ca9145e41e9f35e31c43c0bc1e /Lib/sre.py | |
parent | c2301730b8e07ece0b7c4ff6b6b06a4895d370c7 (diff) | |
download | cpython-git-019bcb598d9b4890a105a0476b9b4e5cb9f14da7.tar.gz |
- changed sre.Scanner to use lastindex instead of index.
Diffstat (limited to 'Lib/sre.py')
-rw-r--r-- | Lib/sre.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/sre.py b/Lib/sre.py index 79f12a1b0f..fbf44a5f3b 100644 --- a/Lib/sre.py +++ b/Lib/sre.py @@ -165,7 +165,7 @@ class Scanner: p = [] for phrase, action in lexicon: p.append("(?:%s)(?P#%d)" % (phrase, len(p))) - self.scanner = sre.compile("|".join(p)) + self.scanner = _compile("|".join(p)) def scan(self, string): result = [] append = result.append @@ -178,7 +178,7 @@ class Scanner: j = m.end() if i == j: break - action = self.lexicon[m.index][1] + action = self.lexicon[m.lastindex][1] if callable(action): self.match = match action = action(self, m.group()) |