load_int: The fallback to long ints was coded in such a way that it
authorTim Peters <tim.peters@gmail.com>
Tue, 28 Aug 2001 22:08:34 +0000 (22:08 +0000)
committerTim Peters <tim.peters@gmail.com>
Tue, 28 Aug 2001 22:08:34 +0000 (22:08 +0000)
couldn't succeed.  Fixed.

Modules/cPickle.c

index 2b058ef446385676ca3dc36b0b616e352ce2497f..60aee6bbb68ff271750ae98ffb3d5eb4f70596ba 100644 (file)
@@ -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;