summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-08-28 22:08:34 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-08-28 22:08:34 (GMT)
commit12778e314b884be72dba30145aff6ce8d0156344 (patch)
tree5b36d6426e5de4a79e875611d151941924cb23d2 /Modules
parent08f99562614f87a02bf27eb0b7c427f6828bd0e9 (diff)
downloadcpython-12778e314b884be72dba30145aff6ce8d0156344.zip
cpython-12778e314b884be72dba30145aff6ce8d0156344.tar.gz
cpython-12778e314b884be72dba30145aff6ce8d0156344.tar.bz2
load_int: The fallback to long ints was coded in such a way that it
couldn't succeed. Fixed.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/cPickle.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/Modules/cPickle.c b/Modules/cPickle.c
index 2b058ef..60aee6b 100644
--- a/Modules/cPickle.c
+++ b/Modules/cPickle.c
@@ -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;