Issue 7117: Replace PyOS_ascii_strtod with PyOS_string_to_double in cPickle as part of short float repr.

This commit is contained in:
Eric Smith 2009-10-27 11:32:11 +00:00
parent 7582ec36b2
commit 97be1ca1d9
1 changed files with 4 additions and 4 deletions

View File

@ -3552,11 +3552,11 @@ load_float(Unpicklerobject *self)
if (len < 2) return bad_readline();
if (!( s=pystrndup(s,len))) return -1;
errno = 0;
d = PyOS_ascii_strtod(s, &endptr);
d = PyOS_string_to_double(s, &endptr, PyExc_OverflowError);
if ((errno == ERANGE && !(fabs(d) <= 1.0)) ||
(endptr[0] != '\n') || (endptr[1] != '\0')) {
if (d == -1.0 && PyErr_Occurred()) {
goto finally;
} else if ((endptr[0] != '\n') || (endptr[1] != '\0')) {
PyErr_SetString(PyExc_ValueError,
"could not convert string to float");
goto finally;