diff options
author | Fredrik Lundh <fredrik@pythonware.com> | 2000-06-29 18:03:25 (GMT) |
---|---|---|
committer | Fredrik Lundh <fredrik@pythonware.com> | 2000-06-29 18:03:25 (GMT) |
commit | 8094611eb8abe9f9d1e1498f36324eebabaa0a09 (patch) | |
tree | c76fec8a4878e16d4bd67717205bb9aac2814108 /Lib/sre.py | |
parent | 34a96371c3685c5631fb1bea8963fd074912bcd9 (diff) | |
download | cpython-8094611eb8abe9f9d1e1498f36324eebabaa0a09.zip cpython-8094611eb8abe9f9d1e1498f36324eebabaa0a09.tar.gz cpython-8094611eb8abe9f9d1e1498f36324eebabaa0a09.tar.bz2 |
- fixed another split problem
(those semantics are weird...)
- got rid of $Id$'s (for the moment, at least). in other
words, there should be no more "empty" checkins.
- internal: some minor cleanups.
Diffstat (limited to 'Lib/sre.py')
-rw-r--r-- | Lib/sre.py | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,6 +1,5 @@ # # Secret Labs' Regular Expression Engine -# $Id$ # # re-compatible interface for the sre matching engine # @@ -135,13 +134,14 @@ def _split(pattern, string, maxsplit=0): if not m: break b, e = m.span() - if e == i: + if b == e: + if i >= len(string): + break continue append(string[i:b]) if g and b != e: extend(m.groups()) i = e n = n + 1 - if i < len(string): - append(string[i:]) + append(string[i:]) return s |