Commits

Philip Jenvey  committed b6d5cac

we assume the larger MAXREPEAT now, skip behavior not applicable to 3.2.3

  • Participants
  • Parent commits 1392e99
  • Branches py3k-stdlib-2.7.6-merge

Comments (0)

Files changed (2)

File lib-python/3/sre_constants.py

 
 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?

File pypy/module/_sre/test/test_app_sre.py

         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)