[Python-checkins] cpython: Removed a code for suport Python version <2.2.
serhiy.storchaka
python-checkins at python.org
Sun Sep 28 14:37:30 CEST 2014
https://hg.python.org/cpython/rev/a4752c32cc79
changeset: 92616:a4752c32cc79
user: Serhiy Storchaka <storchaka at gmail.com>
date: Sun Sep 28 15:36:18 2014 +0300
summary:
Removed a code for suport Python version <2.2.
files:
Lib/re.py | 23 ++++++++++++-----------
1 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/Lib/re.py b/Lib/re.py
--- a/Lib/re.py
+++ b/Lib/re.py
@@ -124,10 +124,13 @@
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 @@
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."
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list