mirror of
https://github.com/python/cpython.git
synced 2025-07-30 14:44:10 +00:00
Fix SF bug 1441486: bad unary minus folding in compiler.
This commit is contained in:
parent
0e07b60a4e
commit
6ec6ab02c3
3 changed files with 60 additions and 20 deletions
|
@ -211,6 +211,10 @@ if 1:
|
|||
self.assertEqual(eval("-" + all_one_bits), -18446744073709551615L)
|
||||
else:
|
||||
self.fail("How many bits *does* this machine have???")
|
||||
# Verify treatment of contant folding on -(sys.maxint+1)
|
||||
# i.e. -2147483648 on 32 bit platforms. Should return int, not long.
|
||||
self.assertTrue(isinstance(eval("%s" % (-sys.maxint - 1)), int))
|
||||
self.assertTrue(isinstance(eval("%s" % (-sys.maxint - 2)), long))
|
||||
|
||||
def test_sequence_unpacking_error(self):
|
||||
# Verify sequence packing/unpacking with "or". SF bug #757818
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue