mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
gh-95605: Fix float(s)
error message when s
contains only whitespace (GH-95665) (GH-95859)
This PR fixes the error message from float(s) in the case where s contains only whitespace.
(cherry picked from commit 97e9cfa75a
)
Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
This commit is contained in:
parent
346aa78af4
commit
b4f968e094
3 changed files with 14 additions and 1 deletions
|
@ -135,6 +135,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!')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue