From 3ce5d9207e66d61d4b0502cf47ed2d2bcdd2212f Mon Sep 17 00:00:00 2001 From: Neal Norwitz Date: Sun, 24 Aug 2008 07:08:55 +0000 Subject: 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 ........ --- Lib/test/seq_tests.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'Lib/test/seq_tests.py') diff --git a/Lib/test/seq_tests.py b/Lib/test/seq_tests.py index 962cfe12ea..5148d4bac2 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]) -- cgit v1.2.1