diff options
author | Tim Peters <tim.peters@gmail.com> | 2001-08-27 19:19:28 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2001-08-27 19:19:28 (GMT) |
commit | 9aa70d93aae89a9404a58f32f3fcd3c72b1ee56b (patch) | |
tree | 1ce75d8726e760f3f47d60503bdb9eefd4227a42 /Lib/test/test_compile.py | |
parent | de1d4957c0bb4d920f130cd809bff865b3ef3c48 (diff) | |
download | cpython-9aa70d93aae89a9404a58f32f3fcd3c72b1ee56b.zip cpython-9aa70d93aae89a9404a58f32f3fcd3c72b1ee56b.tar.gz cpython-9aa70d93aae89a9404a58f32f3fcd3c72b1ee56b.tar.bz2 |
SF bug [#455775] float parsing discrepancy.
PyTokenizer_Get: error if exponent contains no digits (3e, 2.0e+, ...).
Diffstat (limited to 'Lib/test/test_compile.py')
-rw-r--r-- | Lib/test/test_compile.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index 17d3500..0276ba6 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -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") |