Kaydet (Commit) abc9f703 authored tarafından Eric Smith's avatar Eric Smith

Removed PyOS_ascii_atof from ast.c, as mentioned in issue 7117.

üst dd62966a
...@@ -3236,17 +3236,17 @@ parsenumber(struct compiling *c, const char *s) ...@@ -3236,17 +3236,17 @@ parsenumber(struct compiling *c, const char *s)
#ifndef WITHOUT_COMPLEX #ifndef WITHOUT_COMPLEX
if (imflag) { if (imflag) {
complex.real = 0.; complex.real = 0.;
PyFPE_START_PROTECT("atof", return 0) complex.imag = PyOS_string_to_double(s, (char **)&end, NULL);
complex.imag = PyOS_ascii_atof(s); if (complex.imag == -1.0 && PyErr_Occurred())
PyFPE_END_PROTECT(complex) return NULL;
return PyComplex_FromCComplex(complex); return PyComplex_FromCComplex(complex);
} }
else else
#endif #endif
{ {
PyFPE_START_PROTECT("atof", return 0) dx = PyOS_string_to_double(s, NULL, NULL);
dx = PyOS_ascii_atof(s); if (dx == -1.0 && PyErr_Occurred())
PyFPE_END_PROTECT(dx) return NULL;
return PyFloat_FromDouble(dx); return PyFloat_FromDouble(dx);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment