Removed PyOS_ascii_atof from marshal.c, as mentioned in issue 7117. Also brings it more in line with py3k.

This commit is contained in:
Eric Smith 2009-10-27 19:42:57 +00:00
parent 0df2c73d6c
commit b218d289e6
1 changed files with 9 additions and 11 deletions

View File

@ -698,10 +698,9 @@ r_object(RFILE *p)
break; break;
} }
buf[n] = '\0'; buf[n] = '\0';
retval = NULL; dx = PyOS_string_to_double(buf, NULL, NULL);
PyFPE_START_PROTECT("atof", break) if (dx == -1.0 && PyErr_Occurred())
dx = PyOS_ascii_atof(buf); break;
PyFPE_END_PROTECT(dx)
retval = PyFloat_FromDouble(dx); retval = PyFloat_FromDouble(dx);
break; break;
} }
@ -738,10 +737,9 @@ r_object(RFILE *p)
break; break;
} }
buf[n] = '\0'; buf[n] = '\0';
retval = NULL; c.real = PyOS_string_to_double(buf, NULL, NULL);
PyFPE_START_PROTECT("atof", break;) if (c.real == -1.0 && PyErr_Occurred())
c.real = PyOS_ascii_atof(buf); break;
PyFPE_END_PROTECT(c)
n = r_byte(p); n = r_byte(p);
if (n == EOF || r_string(buf, (int)n, p) != n) { if (n == EOF || r_string(buf, (int)n, p) != n) {
PyErr_SetString(PyExc_EOFError, PyErr_SetString(PyExc_EOFError,
@ -750,9 +748,9 @@ r_object(RFILE *p)
break; break;
} }
buf[n] = '\0'; buf[n] = '\0';
PyFPE_START_PROTECT("atof", break) c.imag = PyOS_string_to_double(buf, NULL, NULL);
c.imag = PyOS_ascii_atof(buf); if (c.imag == -1.0 && PyErr_Occurred())
PyFPE_END_PROTECT(c) break;
retval = PyComplex_FromCComplex(c); retval = PyComplex_FromCComplex(c);
break; break;
} }