diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2009-10-26 22:28:14 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2009-10-26 22:28:14 (GMT) |
commit | c04c7c5b72db5bcdde04982cad52212d3ddbc1a1 (patch) | |
tree | 00046238d8b679b724cccec921cff00129d6a4ba /Lib/test/test_complex.py | |
parent | 8568b198506b4d2ff3c0dc847f75989865b1e33e (diff) | |
download | cpython-c04c7c5b72db5bcdde04982cad52212d3ddbc1a1.zip cpython-c04c7c5b72db5bcdde04982cad52212d3ddbc1a1.tar.gz cpython-c04c7c5b72db5bcdde04982cad52212d3ddbc1a1.tar.bz2 |
Issue #7117: Use PyOS_string_to_double instead of PyOS_ascii_strtod in
complexobject.c. Also remove length restriction on unicode inputs to
the complex constructor.
Diffstat (limited to 'Lib/test/test_complex.py')
-rw-r--r-- | Lib/test/test_complex.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_complex.py b/Lib/test/test_complex.py index f07a6b4..a192ec4 100644 --- a/Lib/test/test_complex.py +++ b/Lib/test/test_complex.py @@ -306,7 +306,6 @@ class ComplexTest(unittest.TestCase): self.assertRaises(ValueError, complex, "1+(2j)") self.assertRaises(ValueError, complex, "(1+2j)123") if test_support.have_unicode: - self.assertRaises(ValueError, complex, unicode("1"*500)) self.assertRaises(ValueError, complex, unicode("x")) self.assertRaises(ValueError, complex, "1j+2") self.assertRaises(ValueError, complex, "1e1ej") @@ -317,6 +316,10 @@ class ComplexTest(unittest.TestCase): self.assertRaises(ValueError, complex, "1.11.1j") self.assertRaises(ValueError, complex, "1e1.1j") + if test_support.have_unicode: + # check that complex accepts long unicode strings + self.assertEqual(type(complex(unicode("1"*500))), complex) + class EvilExc(Exception): pass |