summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2010-01-23 10:43:05 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2010-01-23 10:43:05 (GMT)
commit0e4e73240a5dd2098c5e14a5dc745d235d456e07 (patch)
tree72a0df5354fc0ab53a5508862efaef8f9d5ec894
parent5633a8048fd8d59c9b23c98fb7e6419689b06316 (diff)
downloadcpython-0e4e73240a5dd2098c5e14a5dc745d235d456e07.zip
cpython-0e4e73240a5dd2098c5e14a5dc745d235d456e07.tar.gz
cpython-0e4e73240a5dd2098c5e14a5dc745d235d456e07.tar.bz2
Increased the overflow value on test_dealloc to make sure that it is big enough even for wide builds.
-rw-r--r--Lib/test/test_re.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
index 456917a..8136002 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -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])