]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Add better error reporting for MemoryErrors caused by str->float conversions.
authorMark Dickinson <dickinsm@gmail.com>
Sat, 16 Jan 2010 20:33:02 +0000 (20:33 +0000)
committerMark Dickinson <dickinsm@gmail.com>
Sat, 16 Jan 2010 20:33:02 +0000 (20:33 +0000)
Lib/test/test_strtod.py

index 1883820ca5f6a9be8622a660cc8c50455744fea5..189254260cd1aabee05434cb83e425d510b9df8d 100644 (file)
@@ -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)