From d87f22cec82a7c368cd2319c4fadbf4e6159f999 Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Sat, 16 Jan 2010 20:33:02 +0000 Subject: [PATCH] Add better error reporting for MemoryErrors caused by str->float conversions. --- Lib/test/test_strtod.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Lib/test/test_strtod.py b/Lib/test/test_strtod.py index 1883820ca5f..189254260cd 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)