From: Mark Dickinson Date: Fri, 12 Feb 2010 21:16:38 +0000 (+0000) Subject: Check that 'd' isn't allowed as an exponent specifier in inputs to the float function. X-Git-Tag: v2.7a4~193 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=876473bcc8807bdbdb323dd0cc53b18ddeec120d;p=thirdparty%2FPython%2Fcpython.git Check that 'd' isn't allowed as an exponent specifier in inputs to the float function. --- diff --git a/Lib/test/test_float.py b/Lib/test/test_float.py index b043c4d25214..b0f353b1f79f 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)