]> granicus.if.org Git - python/commitdiff
Increased the overflow value on test_dealloc to make sure that it is big enough even...
authorEzio Melotti <ezio.melotti@gmail.com>
Sat, 23 Jan 2010 10:43:05 +0000 (10:43 +0000)
committerEzio Melotti <ezio.melotti@gmail.com>
Sat, 23 Jan 2010 10:43:05 +0000 (10:43 +0000)
Lib/test/test_re.py

index 456917a43deba8bcba535444e6936ce912587130..8136002f746111f5cb4e87ed2ee7fad6bbc07923 100644 (file)
@@ -706,7 +706,11 @@ class ReTests(unittest.TestCase):
     def test_dealloc(self):
         # issue 3299: check for segfault in debug build
         import _sre
-        long_overflow = sys.maxsize + 2
+        # the overflow limit is different on wide and narrow builds and it
+        # depends on the definition of SRE_CODE (see sre.h).
+        # 2**128 should be big enough to overflow on both. For smaller values
+        # a RuntimeError is raised instead of OverflowError.
+        long_overflow = 2**128
         self.assertRaises(TypeError, re.finditer, "a", {})
         self.assertRaises(OverflowError, _sre.compile, "abc", 0, [long_overflow])