mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00: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
1 changed files with 3 additions and 4 deletions
|
@ -2543,9 +2543,8 @@ load_int(Unpicklerobject *self) {
|
||||||
/* Hm, maybe we've got something long. Let's try reading
|
/* Hm, maybe we've got something long. Let's try reading
|
||||||
it as a Python long object. */
|
it as a Python long object. */
|
||||||
errno = 0;
|
errno = 0;
|
||||||
UNLESS (py_int=PyLong_FromString(s,&endptr,0)) goto finally;
|
py_int = PyLong_FromString(s, NULL, 0);
|
||||||
|
if (py_int == NULL) {
|
||||||
if ((*endptr != '\n') || (endptr[1] != '\0')) {
|
|
||||||
PyErr_SetString(PyExc_ValueError,
|
PyErr_SetString(PyExc_ValueError,
|
||||||
"could not convert string to int");
|
"could not convert string to int");
|
||||||
goto finally;
|
goto finally;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue