diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2009-05-20 18:43:07 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2009-05-20 18:43:07 (GMT) |
commit | a4e0efa4b13e9a51faad19be27b18ed02c9a26f0 (patch) | |
tree | 6dd18a300d5e9ac8fdb18fc7a9015d69324f2a1c /Objects/complexobject.c | |
parent | ac2380b58a1bde1b38916c85032bc1647f119346 (diff) | |
download | cpython-a4e0efa4b13e9a51faad19be27b18ed02c9a26f0.zip cpython-a4e0efa4b13e9a51faad19be27b18ed02c9a26f0.tar.gz cpython-a4e0efa4b13e9a51faad19be27b18ed02c9a26f0.tar.bz2 |
Issue #5829: don't raise OverflowError for complex('1e500'). Backport of r72803.
Diffstat (limited to 'Objects/complexobject.c')
-rw-r--r-- | Objects/complexobject.c | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/Objects/complexobject.c b/Objects/complexobject.c index 6e31723..b976b6d 100644 --- a/Objects/complexobject.c +++ b/Objects/complexobject.c @@ -989,8 +989,6 @@ complex_subtype_from_string(PyTypeObject *type, PyObject *v) z = PyOS_ascii_strtod(s, &end); if (end == s && errno == ENOMEM) return PyErr_NoMemory(); - if (errno == ERANGE && fabs(z) >= 1.0) - goto overflow; if (end != s) { /* all 4 forms starting with <float> land here */ @@ -1002,8 +1000,6 @@ complex_subtype_from_string(PyTypeObject *type, PyObject *v) y = PyOS_ascii_strtod(s, &end); if (end == s && errno == ENOMEM) return PyErr_NoMemory(); - if (errno == ERANGE && fabs(y) >= 1.0) - goto overflow; if (end != s) /* <float><signed-float>j */ s = end; @@ -1063,11 +1059,6 @@ complex_subtype_from_string(PyTypeObject *type, PyObject *v) PyErr_SetString(PyExc_ValueError, "complex() arg is a malformed string"); return NULL; - - overflow: - PyErr_SetString(PyExc_OverflowError, - "complex() arg overflow"); - return NULL; } static PyObject * |