Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 35f1c94

Browse files
committed
Merged revisions 71963 via svnmerge from
svn+ssh://[email protected]/python/trunk ........ r71963 | mark.dickinson | 2009-04-26 15:00:08 +0100 (Sun, 26 Apr 2009) | 2 lines Reset errno before both calls to PyOS_ascii_strtod, not just one. ........
1 parent ae9eb5c commit 35f1c94

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Objects/complexobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -746,8 +746,6 @@ complex_subtype_from_string(PyTypeObject *type, PyObject *v)
746746
return NULL;
747747
}
748748

749-
errno = 0;
750-
751749
/* position on first nonblank */
752750
start = s;
753751
while (*s && isspace(Py_CHARMASK(*s)))
@@ -782,6 +780,7 @@ complex_subtype_from_string(PyTypeObject *type, PyObject *v)
782780
*/
783781

784782
/* first look for forms starting with <float> */
783+
errno = 0;
785784
z = PyOS_ascii_strtod(s, &end);
786785
if (end == s && errno == ENOMEM)
787786
return PyErr_NoMemory();
@@ -794,6 +793,7 @@ complex_subtype_from_string(PyTypeObject *type, PyObject *v)
794793
if (*s == '+' || *s == '-') {
795794
/* <float><signed-float>j | <float><sign>j */
796795
x = z;
796+
errno = 0;
797797
y = PyOS_ascii_strtod(s, &end);
798798
if (end == s && errno == ENOMEM)
799799
return PyErr_NoMemory();

0 commit comments

Comments
 (0)