mirror of
https://github.com/python/cpython.git
synced 2026-05-03 00:58:30 +00:00
Add better error reporting for MemoryErrors caused by str->float conversions.
This commit is contained in:
parent
5afe42b69b
commit
d87f22cec8
1 changed files with 2 additions and 0 deletions
|
|
@ -91,6 +91,8 @@ def check_strtod(self, s):
|
|||
fs = float(s)
|
||||
except OverflowError:
|
||||
got = '-inf' if s[0] == '-' else 'inf'
|
||||
except MemoryError:
|
||||
got = 'memory error'
|
||||
else:
|
||||
got = fs.hex()
|
||||
expected = strtod(s)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue