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

Issue 7117: Replace PyOS_ascii_strtod with PyOS_string_to_double in cPickle as…

Issue 7117: Replace PyOS_ascii_strtod with PyOS_string_to_double in cPickle as part of short float repr.
üst 7582ec36
...@@ -3552,11 +3552,11 @@ load_float(Unpicklerobject *self) ...@@ -3552,11 +3552,11 @@ load_float(Unpicklerobject *self)
if (len < 2) return bad_readline(); if (len < 2) return bad_readline();
if (!( s=pystrndup(s,len))) return -1; if (!( s=pystrndup(s,len))) return -1;
errno = 0; d = PyOS_string_to_double(s, &endptr, PyExc_OverflowError);
d = PyOS_ascii_strtod(s, &endptr);
if ((errno == ERANGE && !(fabs(d) <= 1.0)) || if (d == -1.0 && PyErr_Occurred()) {
(endptr[0] != '\n') || (endptr[1] != '\0')) { goto finally;
} else if ((endptr[0] != '\n') || (endptr[1] != '\0')) {
PyErr_SetString(PyExc_ValueError, PyErr_SetString(PyExc_ValueError,
"could not convert string to float"); "could not convert string to float");
goto finally; goto finally;
......
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