Author: Philip Jenvey <[email protected]>
Branch: py3k-stdlib-2.7.6-merge
Changeset: r69842:b6d5cac0138a
Date: 2014-03-10 13:59 -0700
http://bitbucket.org/pypy/pypy/changeset/b6d5cac0138a/
Log: we assume the larger MAXREPEAT now, skip behavior not applicable to
3.2.3
diff --git a/lib-python/3/sre_constants.py b/lib-python/3/sre_constants.py
--- a/lib-python/3/sre_constants.py
+++ b/lib-python/3/sre_constants.py
@@ -15,9 +15,11 @@
MAGIC = 20031017
-# max code word in this release
-
-MAXREPEAT = 65535
+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?
diff --git a/pypy/module/_sre/test/test_app_sre.py
b/pypy/module/_sre/test/test_app_sre.py
--- a/pypy/module/_sre/test/test_app_sre.py
+++ b/pypy/module/_sre/test/test_app_sre.py
@@ -60,6 +60,10 @@
assert re.match(r".{%d}" % (self.s.MAXREPEAT - 1), string) is None
assert re.match(r".{,%d}" % (self.s.MAXREPEAT - 1), string).span() ==
(0, 100000)
assert re.match(r".{%d,}?" % (self.s.MAXREPEAT - 1), string) is None
+ import sys
+ if sys.version_info[:3] <= (3, 2, 3):
+ # XXX: These are fixed in 3.2.4 or so
+ return
raises(OverflowError, re.compile, r".{%d}" % self.s.MAXREPEAT)
raises(OverflowError, re.compile, r".{,%d}" % self.s.MAXREPEAT)
raises(OverflowError, re.compile, r".{%d,}?" % self.s.MAXREPEAT)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit