summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2010-01-23 10:54:37 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2010-01-23 10:54:37 (GMT)
commit68338cd63f8c9ce42c638e492b492b8a0a8c1cc5 (patch)
tree515ca246e27dcad23eed4076139ca09dd1c06982
parent27b11f730e53ff5946d1a94e126f5d62e913119e (diff)
downloadcpython-68338cd63f8c9ce42c638e492b492b8a0a8c1cc5.zip
cpython-68338cd63f8c9ce42c638e492b492b8a0a8c1cc5.tar.gz
cpython-68338cd63f8c9ce42c638e492b492b8a0a8c1cc5.tar.bz2
Merged revisions 77708 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r77708 | ezio.melotti | 2010-01-23 12:49:39 +0200 (Sat, 23 Jan 2010) | 9 lines Merged revisions 77706 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r77706 | ezio.melotti | 2010-01-23 12:43:05 +0200 (Sat, 23 Jan 2010) | 1 line 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 7ef57e1..1626c80 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -699,7 +699,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])