mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
SF bug [#455775] float parsing discrepancy.
PyTokenizer_Get: error if exponent contains no digits (3e, 2.0e+, ...).
This commit is contained in:
parent
de1d4957c0
commit
9aa70d93aa
2 changed files with 23 additions and 5 deletions
|
@ -50,3 +50,18 @@ try:
|
|||
raise TestFailed, "non-default args after default"
|
||||
except SyntaxError:
|
||||
pass
|
||||
|
||||
if verbose:
|
||||
print "testing bad float literals"
|
||||
|
||||
def expect_error(s):
|
||||
try:
|
||||
eval(s)
|
||||
raise TestFailed("%r accepted" % s)
|
||||
except SyntaxError:
|
||||
pass
|
||||
|
||||
expect_error("2e")
|
||||
expect_error("2.0e+")
|
||||
expect_error("1e-")
|
||||
expect_error("3-4e/21")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue