From: Eric Smith Date: Tue, 27 Oct 2009 18:33:14 +0000 (+0000) Subject: Removed PyOS_ascii_atof from ast.c, as mentioned in issue 7117. X-Git-Tag: v2.7a1~229 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=abc9f7038154c5bd5d3a6042ab972f2db0fbc241;p=python Removed PyOS_ascii_atof from ast.c, as mentioned in issue 7117. --- diff --git a/Python/ast.c b/Python/ast.c index 3422c2e1b0..347da2aa95 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -3236,17 +3236,17 @@ parsenumber(struct compiling *c, const char *s) #ifndef WITHOUT_COMPLEX if (imflag) { complex.real = 0.; - PyFPE_START_PROTECT("atof", return 0) - complex.imag = PyOS_ascii_atof(s); - PyFPE_END_PROTECT(complex) + complex.imag = PyOS_string_to_double(s, (char **)&end, NULL); + if (complex.imag == -1.0 && PyErr_Occurred()) + return NULL; return PyComplex_FromCComplex(complex); } else #endif { - PyFPE_START_PROTECT("atof", return 0) - dx = PyOS_ascii_atof(s); - PyFPE_END_PROTECT(dx) + dx = PyOS_string_to_double(s, NULL, NULL); + if (dx == -1.0 && PyErr_Occurred()) + return NULL; return PyFloat_FromDouble(dx); } }