[Python-checkins] r77706 - python/trunk/Lib/test/test_re.py
ezio.melotti
python-checkins at python.org
Sat Jan 23 11:43:05 CET 2010
Author: ezio.melotti
Date: Sat Jan 23 11:43:05 2010
New Revision: 77706
Log:
Increased the overflow value on test_dealloc to make sure that it is big enough even for wide builds.
Modified:
python/trunk/Lib/test/test_re.py
Modified: python/trunk/Lib/test/test_re.py
==============================================================================
--- python/trunk/Lib/test/test_re.py (original)
+++ python/trunk/Lib/test/test_re.py Sat Jan 23 11:43:05 2010
@@ -706,7 +706,11 @@
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])
More information about the Python-checkins
mailing list