Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eb2a5ef

Browse files
committed
Fix SF bug #688424, 64-bit test problems
1 parent 4edaa0d commit eb2a5ef

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

Lib/test/test_compile.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,14 @@ def expect_same(test_source, expected):
145145
# Verify treatment of unary minus on negative numbers SF bug #660455
146146
import warnings
147147
warnings.filterwarnings("ignore", "hex/oct constants", FutureWarning)
148+
warnings.filterwarnings("ignore", "hex.* of negative int", FutureWarning)
148149
# XXX Of course the following test will have to be changed in Python 2.4
149150
# This test is in a <string> so the filterwarnings() can affect it
151+
import sys
152+
all_one_bits = '0xffffffff'
153+
if sys.maxint != 2147483647:
154+
all_one_bits = '0xffffffffffffffff'
150155
exec """
151-
expect_same("0xffffffff", -1)
152-
expect_same("-0xffffffff", 1)
156+
expect_same(all_one_bits, -1)
157+
expect_same("-" + all_one_bits, 1)
153158
"""

Lib/test/test_sys.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def test_refcount(self):
173173

174174
def test_getframe(self):
175175
self.assertRaises(TypeError, sys._getframe, 42, 42)
176-
self.assertRaises(ValueError, sys._getframe, sys.maxint)
176+
self.assertRaises(ValueError, sys._getframe, 2000000000)
177177
self.assert_(
178178
SysModuleTest.test_getframe.im_func.func_code \
179179
is sys._getframe().f_code

0 commit comments

Comments
 (0)