diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2010-02-12 21:16:38 +0000 |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2010-02-12 21:16:38 +0000 |
commit | 876473bcc8807bdbdb323dd0cc53b18ddeec120d (patch) | |
tree | 9cc58845b05e6caf7f76408f420bceb14da96b87 /Lib/test/test_float.py | |
parent | 6164d7ac84b75835d6d09eeaab0bb4d170ba84d5 (diff) | |
download | cpython-git-876473bcc8807bdbdb323dd0cc53b18ddeec120d.tar.gz |
Check that 'd' isn't allowed as an exponent specifier in inputs to the float function.
Diffstat (limited to 'Lib/test/test_float.py')
-rw-r--r-- | Lib/test/test_float.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_float.py b/Lib/test/test_float.py index b043c4d252..b0f353b1f7 100644 --- a/Lib/test/test_float.py +++ b/Lib/test/test_float.py @@ -104,6 +104,9 @@ class GeneralFloatCases(unittest.TestCase): self.assertRaises(ValueError, float, "+-3.14") self.assertRaises(ValueError, float, "-+3.14") self.assertRaises(ValueError, float, "--3.14") + # check that we don't accept alternate exponent markers + self.assertRaises(ValueError, float, "-1.7d29") + self.assertRaises(ValueError, float, "3D-14") if test_support.have_unicode: self.assertEqual(float(unicode(" 3.14 ")), 3.14) self.assertEqual(float(unicode(" \u0663.\u0661\u0664 ",'raw-unicode-escape')), 3.14) |