diff options
Diffstat (limited to 'Modules/cPickle.c')
-rw-r--r-- | Modules/cPickle.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/cPickle.c b/Modules/cPickle.c index 7f836c3126..fb13ba18bc 100644 --- a/Modules/cPickle.c +++ b/Modules/cPickle.c @@ -3465,7 +3465,8 @@ load_float(Unpicklerobject *self) errno = 0; d = PyOS_ascii_strtod(s, &endptr); - if (errno || (endptr[0] != '\n') || (endptr[1] != '\0')) { + if ((errno == ERANGE && !(fabs(d) <= 1.0)) || + (endptr[0] != '\n') || (endptr[1] != '\0')) { PyErr_SetString(PyExc_ValueError, "could not convert string to float"); goto finally; |