]> granicus.if.org Git - python/commitdiff
Removed a code for suport Python version <2.2.
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 28 Sep 2014 12:36:18 +0000 (15:36 +0300)
committerSerhiy Storchaka <storchaka@gmail.com>
Sun, 28 Sep 2014 12:36:18 +0000 (15:36 +0300)
Lib/re.py

index 2e4d87c3f5c89bd4b9f8bfbd1e8f04fcbc3df8c8..2a410c8d7676b7e935a5d88c4c8625f8fc5b4ae1 100644 (file)
--- a/Lib/re.py
+++ b/Lib/re.py
@@ -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."