mirror of
https://github.com/python/cpython.git
synced 2025-08-21 17:25:34 +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
|
@ -1,5 +1,7 @@
|
|||
from test.test_support import verbose, have_unicode, TestFailed
|
||||
import sys
|
||||
from test.test_support import MAX_Py_ssize_t
|
||||
maxsize = MAX_Py_ssize_t
|
||||
|
||||
# test string formatting operator (I am not sure if this is being tested
|
||||
# elsewhere but, surely, some of the given cases are *not* tested because
|
||||
|
@ -238,11 +240,11 @@ class Foobar(long):
|
|||
test_exc('%o', Foobar(), TypeError,
|
||||
"expected string or Unicode object, long found")
|
||||
|
||||
if sys.maxint == 2**31-1:
|
||||
if maxsize == 2**31-1:
|
||||
# crashes 2.2.1 and earlier:
|
||||
try:
|
||||
"%*d"%(sys.maxint, -127)
|
||||
"%*d"%(maxsize, -127)
|
||||
except MemoryError:
|
||||
pass
|
||||
else:
|
||||
raise TestFailed, '"%*d"%(sys.maxint, -127) should fail'
|
||||
raise TestFailed, '"%*d"%(maxsize, -127) should fail'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue