summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_grammar.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2003-11-29 23:52:13 (GMT)
committerGuido van Rossum <guido@python.org>2003-11-29 23:52:13 (GMT)
commit6c9e130524533263b690e86639a36b6f3e7a8eeb (patch)
tree39023f825688f630245ddcaa60af9942a859522c /Lib/test/test_grammar.py
parent37e136373e0d9ab3bdf25ecd9c42b86281ed21d3 (diff)
downloadcpython-6c9e130524533263b690e86639a36b6f3e7a8eeb.zip
cpython-6c9e130524533263b690e86639a36b6f3e7a8eeb.tar.gz
cpython-6c9e130524533263b690e86639a36b6f3e7a8eeb.tar.bz2
- 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_grammar.py')
-rw-r--r--Lib/test/test_grammar.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py
index c57bbed..6666c13 100644
--- a/Lib/test/test_grammar.py
+++ b/Lib/test/test_grammar.py
@@ -39,20 +39,20 @@ except ImportError:
if maxint == 2147483647:
# The following test will start to fail in Python 2.4;
# change the 020000000000 to -020000000000
- if -2147483647-1 != 020000000000: raise TestFailed, 'max negative int'
+ if -2147483647-1 != -020000000000: raise TestFailed, 'max negative int'
# XXX -2147483648
- if 037777777777 != -1: raise TestFailed, 'oct -1'
- if 0xffffffff != -1: raise TestFailed, 'hex -1'
+ if 037777777777 < 0: raise TestFailed, 'large oct'
+ if 0xffffffff < 0: raise TestFailed, 'large hex'
for s in '2147483648', '040000000000', '0x100000000':
try:
x = eval(s)
except OverflowError:
print "OverflowError on huge integer literal " + `s`
elif eval('maxint == 9223372036854775807'):
- if eval('-9223372036854775807-1 != 01000000000000000000000'):
+ if eval('-9223372036854775807-1 != -01000000000000000000000'):
raise TestFailed, 'max negative int'
- if eval('01777777777777777777777') != -1: raise TestFailed, 'oct -1'
- if eval('0xffffffffffffffff') != -1: raise TestFailed, 'hex -1'
+ if eval('01777777777777777777777') < 0: raise TestFailed, 'large oct'
+ if eval('0xffffffffffffffff') < 0: raise TestFailed, 'large hex'
for s in '9223372036854775808', '02000000000000000000000', \
'0x10000000000000000':
try: