]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merged revisions 78166 via svnmerge from
authorMark Dickinson <dickinsm@gmail.com>
Fri, 12 Feb 2010 21:18:34 +0000 (21:18 +0000)
committerMark Dickinson <dickinsm@gmail.com>
Fri, 12 Feb 2010 21:18:34 +0000 (21:18 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r78166 | mark.dickinson | 2010-02-12 21:16:38 +0000 (Fri, 12 Feb 2010) | 1 line

  Check that 'd' isn't allowed as an exponent specifier in inputs to the float function.
........

Lib/test/test_float.py

index 0538b0c6dbb4585445e23843148405d54dc6bc6a..c3d6cbf85402890fa065f5b8463200d0291e1535 100644 (file)
@@ -107,6 +107,9 @@ class GeneralFloatCases(unittest.TestCase):
         self.assertRaises(ValueError, float, "+.inf")
         self.assertRaises(ValueError, float, ".")
         self.assertRaises(ValueError, float, "-.")
+        # check that we don't accept alternate exponent markers
+        self.assertRaises(ValueError, float, "-1.7d29")
+        self.assertRaises(ValueError, float, "3D-14")
         self.assertEqual(float(b"  \u0663.\u0661\u0664  ".decode('raw-unicode-escape')), 3.14)
         # extra long strings should not be a problem
         float(b'.' + b'1'*1000)