summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2009-04-26 14:11:18 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2009-04-26 14:11:18 (GMT)
commit35f1c9470a28174d2ba0ccf5d2c284d0b5debe39 (patch)
tree1c37a00498b7f3107f7a994249f2303828289a48 /Objects
parentae9eb5c4d00682af7f7835c74f20f50d83720f2d (diff)
downloadcpython-35f1c9470a28174d2ba0ccf5d2c284d0b5debe39.zip
cpython-35f1c9470a28174d2ba0ccf5d2c284d0b5debe39.tar.gz
cpython-35f1c9470a28174d2ba0ccf5d2c284d0b5debe39.tar.bz2
Merged revisions 71963 via svnmerge from
svn+ssh://pythondev@svn.python.org/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. ........
Diffstat (limited to 'Objects')
-rw-r--r--Objects/complexobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/complexobject.c b/Objects/complexobject.c
index 37d9888..acd885b 100644
--- a/Objects/complexobject.c
+++ b/Objects/complexobject.c
@@ -746,8 +746,6 @@ complex_subtype_from_string(PyTypeObject *type, PyObject *v)
return NULL;
}
- errno = 0;
-
/* position on first nonblank */
start = s;
while (*s && isspace(Py_CHARMASK(*s)))
@@ -782,6 +780,7 @@ complex_subtype_from_string(PyTypeObject *type, PyObject *v)
*/
/* first look for forms starting with <float> */
+ errno = 0;
z = PyOS_ascii_strtod(s, &end);
if (end == s && errno == ENOMEM)
return PyErr_NoMemory();
@@ -794,6 +793,7 @@ complex_subtype_from_string(PyTypeObject *type, PyObject *v)
if (*s == '+' || *s == '-') {
/* <float><signed-float>j | <float><sign>j */
x = z;
+ errno = 0;
y = PyOS_ascii_strtod(s, &end);
if (end == s && errno == ENOMEM)
return PyErr_NoMemory();