mirror of
https://github.com/python/cpython.git
synced 2025-08-22 01:35:16 +00:00
Merging change 55102 from the trunk:
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.
This commit is contained in:
parent
4e6b5e9ead
commit
7bca027f64
4 changed files with 17 additions and 10 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue