mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
Issue2681: the literal 0o8 was wrongly accepted, and evaluated as float(0.0).
This happened only when 8 is the first digit. Credits go to Lukas Meuser.
This commit is contained in:
parent
11034c6c16
commit
5216721a53
3 changed files with 5 additions and 2 deletions
|
|
@ -183,7 +183,7 @@ if 1:
|
|||
for arg in ["077787", "0xj", "0x.", "0e", "090000000000000",
|
||||
"080000000000000", "000000000000009", "000000000000008",
|
||||
"0b42", "0BADCAFE", "0o123456789", "0b1.1", "0o4.2",
|
||||
"0b101j2", "0o153j2", "0b100e1", "0o777e1"]:
|
||||
"0b101j2", "0o153j2", "0b100e1", "0o777e1", "0o8", "0o78"]:
|
||||
self.assertRaises(SyntaxError, eval, arg)
|
||||
|
||||
self.assertEqual(eval("0777"), 511)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue