summaryrefslogtreecommitdiff
path: root/Lib/test/test_compile.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2003-11-29 23:52:13 +0000
committerGuido van Rossum <guido@python.org>2003-11-29 23:52:13 +0000
commitc4ffc65362862c019af98a7ea900337fb770e0d9 (patch)
treeb3ecb9af1f61cd04cff6346dfe02ed4322ceeeb9 /Lib/test/test_compile.py
parenta8a7a1287aaf4ac333d1fc41a8888afea7c27882 (diff)
downloadcpython-c4ffc65362862c019af98a7ea900337fb770e0d9.tar.gz
- Removed FutureWarnings related to hex/oct literals and conversions
and left shifts. (Thanks to Kalle Svensson for SF patch 849227.) This addresses most of the remaining semantic changes promised by PEP 237, except for repr() of a long, which still shows the trailing 'L'. The PEP appears to promise warnings for operations that changed semantics compared to Python 2.3, but this is not implemented; we've suffered through enough warnings related to hex/oct literals and I think it's best to be silent now.
Diffstat (limited to 'Lib/test/test_compile.py')
-rw-r--r--Lib/test/test_compile.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py
index 4d4ba4f058..e2b1c9500d 100644
--- a/Lib/test/test_compile.py
+++ b/Lib/test/test_compile.py
@@ -119,15 +119,18 @@ if 1:
def test_unary_minus(self):
# Verify treatment of unary minus on negative numbers SF bug #660455
- warnings.filterwarnings("ignore", "hex/oct constants", FutureWarning)
- warnings.filterwarnings("ignore", "hex.* of negative int", FutureWarning)
- # XXX Of course the following test will have to be changed in Python 2.4
- # This test is in a <string> so the filterwarnings() can affect it
- all_one_bits = '0xffffffff'
- if sys.maxint != 2147483647:
+ if sys.maxint == 2147483647:
+ # 32-bit machine
+ all_one_bits = '0xffffffff'
+ self.assertEqual(eval(all_one_bits), 4294967295L)
+ self.assertEqual(eval("-" + all_one_bits), -4294967295L)
+ elif sys.maxint == 9223372036854775807:
+ # 64-bit machine
all_one_bits = '0xffffffffffffffff'
- self.assertEqual(eval(all_one_bits), -1)
- self.assertEqual(eval("-" + all_one_bits), 1)
+ self.assertEqual(eval(all_one_bits), 18446744073709551615L)
+ self.assertEqual(eval("-" + all_one_bits), -18446744073709551615L)
+ else:
+ self.fail("How many bits *does* this machine have???")
def test_sequence_unpacking_error(self):
# Verify sequence packing/unpacking with "or". SF bug #757818