diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2010-02-12 21:18:34 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2010-02-12 21:18:34 (GMT) |
commit | c2d8689150ae86e07dc001b38e24c737849ca028 (patch) | |
tree | 05a489097b5ff2894eeec6d7beff5f942e867ba2 /Lib/test | |
parent | edeacda11824c474c8883c2f7b6f5f2c12abb201 (diff) | |
download | cpython-c2d8689150ae86e07dc001b38e24c737849ca028.zip cpython-c2d8689150ae86e07dc001b38e24c737849ca028.tar.gz cpython-c2d8689150ae86e07dc001b38e24c737849ca028.tar.bz2 |
Merged revisions 78166 via svnmerge from
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.
........
Diffstat (limited to 'Lib/test')
-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 0538b0c..c3d6cbf 100644 --- a/Lib/test/test_float.py +++ b/Lib/test/test_float.py @@ -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) |