mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
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.
This commit is contained in:
parent
8568b19850
commit
c04c7c5b72
3 changed files with 36 additions and 17 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue