summaryrefslogtreecommitdiffstats
path: root/Lib/test/string_tests.py
diff options
context:
space:
mode:
authorKristján Valur Jónsson <kristjan@ccpgames.com>2007-05-03 20:09:56 (GMT)
committerKristján Valur Jónsson <kristjan@ccpgames.com>2007-05-03 20:09:56 (GMT)
commit170eee9d6ae4ad4270cfd164c046c2381d746191 (patch)
tree75570ad8d2a1b630046f6753a6a7fd2c2c11a17c /Lib/test/string_tests.py
parent19ac472ba12c41e201b91a45e21ebc0b079d3ca1 (diff)
downloadcpython-170eee9d6ae4ad4270cfd164c046c2381d746191.zip
cpython-170eee9d6ae4ad4270cfd164c046c2381d746191.tar.gz
cpython-170eee9d6ae4ad4270cfd164c046c2381d746191.tar.bz2
Fix those parts in the testsuite that assumed that sys.maxint would cause overflow on x64. Now the testsuite is well behaved on that platform.
Diffstat (limited to 'Lib/test/string_tests.py')
-rw-r--r--Lib/test/string_tests.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/string_tests.py b/Lib/test/string_tests.py
index baac252..3570ef1 100644
--- a/Lib/test/string_tests.py
+++ b/Lib/test/string_tests.py
@@ -2,7 +2,7 @@
Common tests shared by test_str, test_unicode, test_userstring and test_string.
"""
-import unittest, string, sys
+import unittest, string, sys, struct
from test import test_support
from UserList import UserList
@@ -671,7 +671,7 @@ class CommonTest(unittest.TestCase):
def test_replace_overflow(self):
# Check for overflow checking on 32 bit machines
- if sys.maxint != 2147483647:
+ if sys.maxint != 2147483647 or struct.calcsize("P") > 4:
return
A2_16 = "A" * (2**16)
self.checkraises(OverflowError, A2_16, "replace", "", A2_16)