diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2022-08-10 18:25:39 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-10 18:25:39 (GMT) |
commit | 97e9cfa75a80b54a0630b7371f35e368a12749d1 (patch) | |
tree | 75e148bc8a55cd77ddc9cf81175079c3bf52d186 /Lib/test/test_float.py | |
parent | 37c0f9ccc06750a7e22f5c176df39373f7aca526 (diff) | |
download | cpython-97e9cfa75a80b54a0630b7371f35e368a12749d1.zip cpython-97e9cfa75a80b54a0630b7371f35e368a12749d1.tar.gz cpython-97e9cfa75a80b54a0630b7371f35e368a12749d1.tar.bz2 |
gh-95605: Fix `float(s)` error message when `s` contains only whitespace (GH-95665)
This PR fixes the error message from float(s) in the case where s contains only whitespace.
Diffstat (limited to 'Lib/test/test_float.py')
-rw-r--r-- | Lib/test/test_float.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_float.py b/Lib/test/test_float.py index b5e271a..f8350c1 100644 --- a/Lib/test/test_float.py +++ b/Lib/test/test_float.py @@ -137,6 +137,10 @@ class GeneralFloatCases(unittest.TestCase): check('123\xbd') check(' 123 456 ') check(b' 123 456 ') + # all whitespace (cf. https://github.com/python/cpython/issues/95605) + check('') + check(' ') + check('\t \n') # non-ascii digits (error came from non-digit '!') check('\u0663\u0661\u0664!') |