]> granicus.if.org Git - python/commitdiff
Revert the last odd change to PyNumber_Long: the problem it was trying
authorTim Peters <tim.peters@gmail.com>
Sat, 2 Mar 2002 04:14:21 +0000 (04:14 +0000)
committerTim Peters <tim.peters@gmail.com>
Sat, 2 Mar 2002 04:14:21 +0000 (04:14 +0000)
to fix was almost certainly a bug in _PyLong_Copy (which I'll fix next).

Objects/abstract.c

index cae474c1d681c04faf4cd0ef49888b1b32544dc9..2acfd0865cecec9b75e025dfd04f2adc97c8d65a 100644 (file)
@@ -933,16 +933,8 @@ PyNumber_Long(PyObject *o)
                Py_INCREF(o);
                return o;
        }
-       if (PyLong_Check(o)) {
-               PyObject *res;
-
-               res = _PyLong_Copy((PyLongObject *)o);
-               if (res != NULL)
-                       ((PyLongObject *)res)->ob_size =
-                               ((PyLongObject *)o)->ob_size;
-
-               return res;
-       }
+       if (PyLong_Check(o))
+               return _PyLong_Copy((PyLongObject *)o);
        if (PyString_Check(o))
                /* need to do extra error checking that PyLong_FromString() 
                 * doesn't do.  In particular long('9.5') must raise an