summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2010-01-16 20:33:02 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2010-01-16 20:33:02 (GMT)
commitd87f22cec82a7c368cd2319c4fadbf4e6159f999 (patch)
treefdb6603e0772a180a5f0ddccc7d34c83d7b69d27 /Lib
parent5afe42b69bcd576aa65a8103eebf314757e67a62 (diff)
downloadcpython-d87f22cec82a7c368cd2319c4fadbf4e6159f999.zip
cpython-d87f22cec82a7c368cd2319c4fadbf4e6159f999.tar.gz
cpython-d87f22cec82a7c368cd2319c4fadbf4e6159f999.tar.bz2
Add better error reporting for MemoryErrors caused by str->float conversions.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_strtod.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_strtod.py b/Lib/test/test_strtod.py
index 1883820..1892542 100644
--- a/Lib/test/test_strtod.py
+++ b/Lib/test/test_strtod.py
@@ -91,6 +91,8 @@ class StrtodTests(unittest.TestCase):
fs = float(s)
except OverflowError:
got = '-inf' if s[0] == '-' else 'inf'
+ except MemoryError:
+ got = 'memory error'
else:
got = fs.hex()
expected = strtod(s)