[Python-checkins] python/dist/src/Lib/test test_compile.py,1.14,1.15

gvanrossum@users.sourceforge.net gvanrossum@users.sourceforge.net
Wed, 12 Feb 2003 08:57:49 -0800


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1:/tmp/cvs-serv6504a

Modified Files:
	test_compile.py 
Log Message:
SF #660455 : patch by NNorwitz.

"Unsigned" (i.e., positive-looking, but really negative) hex/oct
constants with a leading minus sign are once again properly negated.
The micro-optimization for negated numeric constants did the wrong
thing for such hex/oct constants.  The patch avoids the optimization
for all hex/oct constants.

This needs to be backported to Python 2.2!


Index: test_compile.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_compile.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** test_compile.py	28 Jan 2003 20:39:49 -0000	1.14
--- test_compile.py	12 Feb 2003 16:57:47 -0000	1.15
***************
*** 134,141 ****
  expect_same("000000000000009.", 9.)
  
! ## # Verify treatment of unary minus on negative numbers SF bug #660455
! ## import warnings
! ## warnings.filterwarnings("ignore", "hex/oct constants", FutureWarning)
! ## # XXX Of course the following test will have to be changed in Python 2.4
! ## expect_same("0xffffffff", -1)
! ## expect_same("-0xffffffff", 1)
--- 134,144 ----
  expect_same("000000000000009.", 9.)
  
! # Verify treatment of unary minus on negative numbers SF bug #660455
! import warnings
! warnings.filterwarnings("ignore", "hex/oct constants", 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
! exec """
! expect_same("0xffffffff", -1)
! expect_same("-0xffffffff", 1)
! """