]> granicus.if.org Git - python/commitdiff
Issue #18050: Fixed an incompatibility of the re module with Python 2.7.3
authorSerhiy Storchaka <storchaka@gmail.com>
Fri, 20 Sep 2013 18:25:53 +0000 (21:25 +0300)
committerSerhiy Storchaka <storchaka@gmail.com>
Fri, 20 Sep 2013 18:25:53 +0000 (21:25 +0300)
and older binaries.

Lib/sre_compile.py
Lib/sre_constants.py
Lib/sre_parse.py
Misc/NEWS

index 15d23243c167dd6309749022396c98c743c904be..97c1663b0b96d8807f1afb67fc0c77ec6dee46b0 100644 (file)
@@ -13,7 +13,6 @@
 import _sre, sys
 import sre_parse
 from sre_constants import *
-from _sre import MAXREPEAT
 
 assert _sre.MAGIC == MAGIC, "SRE module mismatch"
 
index b0175e71be6597717244555654e3a9268bb6b439..69224e274c5cc3e00c735085b8033d0d579f3a0f 100644 (file)
 
 MAGIC = 20031017
 
-from _sre import MAXREPEAT
+try:
+    from _sre import MAXREPEAT
+except ImportError:
+    import _sre
+    MAXREPEAT = _sre.MAXREPEAT = 65535
 
 # SRE standard exception (access as sre.error)
 # should this really be here?
index e8d35a6d41251a270c5eddb3215fe0c322491543..e37e2cfce3f81a6ffaba4b2e5eb3a9a35d13748c 100644 (file)
@@ -15,7 +15,6 @@
 import sys
 
 from sre_constants import *
-from _sre import MAXREPEAT
 
 SPECIAL_CHARS = ".\\[{()*+?^$|"
 REPEAT_CHARS = "*+?{"
index 3c44f00ec0faf971282e9955794fb9f9672486bb..61832f831cf3c9f2d30887b4c669f0d59850998d 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -32,6 +32,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #18050: Fixed an incompatibility of the re module with Python 2.7.3
+  and older binaries.
+
 - Issue #19037: The mailbox module now makes all changes to maildir files
   before moving them into place, to avoid race conditions with other programs
   that may be accessing the maildir directory.