Commit be4de52f authored by Serhiy Storchaka's avatar Serhiy Storchaka

Removed a code for suport Python version <2.2.

parent 20b39b27
...@@ -124,10 +124,13 @@ import sre_compile ...@@ -124,10 +124,13 @@ import sre_compile
import sre_parse import sre_parse
# public symbols # public symbols
__all__ = [ "match", "fullmatch", "search", "sub", "subn", "split", "findall", __all__ = [
"compile", "purge", "template", "escape", "A", "I", "L", "M", "S", "X", "match", "fullmatch", "search", "sub", "subn", "split",
"U", "ASCII", "IGNORECASE", "LOCALE", "MULTILINE", "DOTALL", "VERBOSE", "findall", "finditer", "compile", "purge", "template", "escape",
"UNICODE", "error" ] "error", "A", "I", "L", "M", "S", "X", "U",
"ASCII", "IGNORECASE", "LOCALE", "MULTILINE", "DOTALL", "VERBOSE",
"UNICODE",
]
__version__ = "2.2.1" __version__ = "2.2.1"
...@@ -205,14 +208,12 @@ def findall(pattern, string, flags=0): ...@@ -205,14 +208,12 @@ def findall(pattern, string, flags=0):
Empty matches are included in the result.""" Empty matches are included in the result."""
return _compile(pattern, flags).findall(string) return _compile(pattern, flags).findall(string)
if sys.hexversion >= 0x02020000: def finditer(pattern, string, flags=0):
__all__.append("finditer") """Return an iterator over all non-overlapping matches in the
def finditer(pattern, string, flags=0): string. For each match, the iterator returns a match object.
"""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.""" Empty matches are included in the result."""
return _compile(pattern, flags).finditer(string) return _compile(pattern, flags).finditer(string)
def compile(pattern, flags=0): def compile(pattern, flags=0):
"Compile a regular expression pattern, returning a pattern object." "Compile a regular expression pattern, returning a pattern object."
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment