diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-09-28 12:36:18 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-09-28 12:36:18 (GMT) |
commit | be4de52fb1ef023bdfdf2e601dd6eb7b9e5e6657 (patch) | |
tree | 9de337e9df5368c86e89edc6a6c6c675ce117253 /Lib/re.py | |
parent | 20b39b27d96b7c068f364ea79584feaa70fd15b6 (diff) | |
download | cpython-be4de52fb1ef023bdfdf2e601dd6eb7b9e5e6657.zip cpython-be4de52fb1ef023bdfdf2e601dd6eb7b9e5e6657.tar.gz cpython-be4de52fb1ef023bdfdf2e601dd6eb7b9e5e6657.tar.bz2 |
Removed a code for suport Python version <2.2.
Diffstat (limited to 'Lib/re.py')
-rw-r--r-- | Lib/re.py | 23 |
1 files changed, 12 insertions, 11 deletions
@@ -124,10 +124,13 @@ import sre_compile import sre_parse # public symbols -__all__ = [ "match", "fullmatch", "search", "sub", "subn", "split", "findall", - "compile", "purge", "template", "escape", "A", "I", "L", "M", "S", "X", - "U", "ASCII", "IGNORECASE", "LOCALE", "MULTILINE", "DOTALL", "VERBOSE", - "UNICODE", "error" ] +__all__ = [ + "match", "fullmatch", "search", "sub", "subn", "split", + "findall", "finditer", "compile", "purge", "template", "escape", + "error", "A", "I", "L", "M", "S", "X", "U", + "ASCII", "IGNORECASE", "LOCALE", "MULTILINE", "DOTALL", "VERBOSE", + "UNICODE", +] __version__ = "2.2.1" @@ -205,14 +208,12 @@ def findall(pattern, string, flags=0): Empty matches are included in the result.""" return _compile(pattern, flags).findall(string) -if sys.hexversion >= 0x02020000: - __all__.append("finditer") - def finditer(pattern, string, flags=0): - """Return an iterator over all non-overlapping matches in the - string. For each match, the iterator returns a match object. +def finditer(pattern, string, flags=0): + """Return an iterator over all non-overlapping matches in the + string. For each match, the iterator returns a match object. - Empty matches are included in the result.""" - return _compile(pattern, flags).finditer(string) + Empty matches are included in the result.""" + return _compile(pattern, flags).finditer(string) def compile(pattern, flags=0): "Compile a regular expression pattern, returning a pattern object." |