summaryrefslogtreecommitdiffstats
path: root/Lib/test/seq_tests.py
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2008-08-24 07:08:55 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2008-08-24 07:08:55 (GMT)
commit3ce5d9207e66d61d4b0502cf47ed2d2bcdd2212f (patch)
treec29add3a6b61f321009d73a91464f45b5d10862a /Lib/test/seq_tests.py
parent06db799a53cba0396908d291bbe4bcc6c1c50daa (diff)
downloadcpython-3ce5d9207e66d61d4b0502cf47ed2d2bcdd2212f.zip
cpython-3ce5d9207e66d61d4b0502cf47ed2d2bcdd2212f.tar.gz
cpython-3ce5d9207e66d61d4b0502cf47ed2d2bcdd2212f.tar.bz2
Closes release blocker #3627.
Merged revisions 65335 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk TESTED=./python -E -tt ./Lib/test/regrtest.py -uall (both debug and opt) ........ r65335 | neal.norwitz | 2008-07-31 10:17:14 -0700 (Thu, 31 Jul 2008) | 1 line Security patches from Apple: prevent int overflow when allocating memory ........
Diffstat (limited to 'Lib/test/seq_tests.py')
-rw-r--r--Lib/test/seq_tests.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/Lib/test/seq_tests.py b/Lib/test/seq_tests.py
index 962cfe1..5148d4b 100644
--- a/Lib/test/seq_tests.py
+++ b/Lib/test/seq_tests.py
@@ -304,11 +304,13 @@ class CommonTest(unittest.TestCase):
self.assertEqual(id(s), id(s*1))
def test_bigrepeat(self):
- x = self.type2test([0])
- x *= 2**16
- self.assertRaises(MemoryError, x.__mul__, 2**16)
- if hasattr(x, '__imul__'):
- self.assertRaises(MemoryError, x.__imul__, 2**16)
+ import sys
+ if sys.maxsize <= 2147483647:
+ x = self.type2test([0])
+ x *= 2**16
+ self.assertRaises(MemoryError, x.__mul__, 2**16)
+ if hasattr(x, '__imul__'):
+ self.assertRaises(MemoryError, x.__imul__, 2**16)
def test_subscript(self):
a = self.type2test([10, 11])