[Python-checkins] r78167 - in python/branches/py3k: Lib/test/test_float.py
mark.dickinson
python-checkins at python.org
Fri Feb 12 22:18:35 CET 2010
Author: mark.dickinson
Date: Fri Feb 12 22:18:34 2010
New Revision: 78167
Log:
Merged revisions 78166 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r78166 | mark.dickinson | 2010年02月12日 21:16:38 +0000 (2010年2月12日) | 1 line
Check that 'd' isn't allowed as an exponent specifier in inputs to the float function.
........
Modified:
python/branches/py3k/ (props changed)
python/branches/py3k/Lib/test/test_float.py
Modified: python/branches/py3k/Lib/test/test_float.py
==============================================================================
--- python/branches/py3k/Lib/test/test_float.py (original)
+++ python/branches/py3k/Lib/test/test_float.py Fri Feb 12 22:18:34 2010
@@ -107,6 +107,9 @@
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)
More information about the Python-checkins
mailing list