Mercurial > cpython-lru_cache-weakref
diff Objects/complexobject.c @ 53464:75963372b714 legacy-trunk
Reset errno before both calls to PyOS_ascii_strtod, not just one.
| author | Mark Dickinson <dickinsm@gmail.com> |
|---|---|
| date | Sun, 26 Apr 2009 14:00:08 +0000 |
| parents | 5fd0da2a9778 |
| children | 34e7c1b14495 |
line wrap: on
line diff
--- a/Objects/complexobject.c Sun Apr 26 10:05:11 2009 +0000 +++ b/Objects/complexobject.c Sun Apr 26 14:00:08 2009 +0000 @@ -911,8 +911,6 @@ return NULL; } - errno = 0; - /* position on first nonblank */ start = s; while (*s && isspace(Py_CHARMASK(*s))) @@ -947,6 +945,7 @@ */ /* first look for forms starting with <float> */ + errno = 0; z = PyOS_ascii_strtod(s, &end); if (end == s && errno == ENOMEM) return PyErr_NoMemory(); @@ -959,6 +958,7 @@ 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();
