diff options
author | Fredrik Lundh <fredrik@pythonware.com> | 2000-06-30 07:50:59 (GMT) |
---|---|---|
committer | Fredrik Lundh <fredrik@pythonware.com> | 2000-06-30 07:50:59 (GMT) |
commit | 90a07913229ada1bb3011cfa08a1e56bca31daaf (patch) | |
tree | 753ada4e42f130dddf2af3bccfecaafd5987abbf /Lib/sre.py | |
parent | df02d0b3f0f438e6a773528010cc360d01b8f393 (diff) | |
download | cpython-90a07913229ada1bb3011cfa08a1e56bca31daaf.zip cpython-90a07913229ada1bb3011cfa08a1e56bca31daaf.tar.gz cpython-90a07913229ada1bb3011cfa08a1e56bca31daaf.tar.bz2 |
- pedantic: make sure "python -t" doesn't complain...
Diffstat (limited to 'Lib/sre.py')
-rw-r--r-- | Lib/sre.py | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -98,7 +98,7 @@ def _subn(pattern, template, string, count=0): if callable(template): filter = template else: - template = sre_parse.parse_template(template, pattern) + template = sre_parse.parse_template(template, pattern) def filter(match, template=template): return sre_parse.expand_template(template, match) n = i = 0 @@ -109,11 +109,11 @@ def _subn(pattern, template, string, count=0): m = c.search() if not m: break - b, e = m.span() + b, e = m.span() if i < b: append(string[i:b]) append(filter(m)) - i = e + i = e n = n + 1 append(string[i:]) return string[:0].join(s), n @@ -130,15 +130,15 @@ def _split(pattern, string, maxsplit=0): m = c.search() if not m: break - b, e = m.span() - if b == e: - if i >= len(string): - break - continue + b, e = m.span() + if b == e: + if i >= len(string): + break + continue append(string[i:b]) - if g and b != e: - extend(m.groups()) - i = e + if g and b != e: + extend(m.groups()) + i = e n = n + 1 append(string[i:]) return s |