mirror of
https://github.com/python/cpython.git
synced 2024-11-26 11:24:40 +08:00
load_int: The fallback to long ints was coded in such a way that it
couldn't succeed. Fixed.
This commit is contained in:
parent
08f9956261
commit
12778e314b
@ -2542,10 +2542,9 @@ load_int(Unpicklerobject *self) {
|
||||
if (errno || (*endptr != '\n') || (endptr[1] != '\0')) {
|
||||
/* Hm, maybe we've got something long. Let's try reading
|
||||
it as a Python long object. */
|
||||
errno=0;
|
||||
UNLESS (py_int=PyLong_FromString(s,&endptr,0)) goto finally;
|
||||
|
||||
if ((*endptr != '\n') || (endptr[1] != '\0')) {
|
||||
errno = 0;
|
||||
py_int = PyLong_FromString(s, NULL, 0);
|
||||
if (py_int == NULL) {
|
||||
PyErr_SetString(PyExc_ValueError,
|
||||
"could not convert string to int");
|
||||
goto finally;
|
||||
|
Loading…
Reference in New Issue
Block a user