mirror of
https://github.com/python/cpython.git
synced 2025-11-03 03:22:27 +00:00
Revert the last odd change to PyNumber_Long: the problem it was trying
to fix was almost certainly a bug in _PyLong_Copy (which I'll fix next).
This commit is contained in:
parent
ffd05ee90d
commit
db30ac41de
1 changed files with 2 additions and 10 deletions
|
|
@ -933,16 +933,8 @@ PyNumber_Long(PyObject *o)
|
||||||
Py_INCREF(o);
|
Py_INCREF(o);
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
if (PyLong_Check(o)) {
|
if (PyLong_Check(o))
|
||||||
PyObject *res;
|
return _PyLong_Copy((PyLongObject *)o);
|
||||||
|
|
||||||
res = _PyLong_Copy((PyLongObject *)o);
|
|
||||||
if (res != NULL)
|
|
||||||
((PyLongObject *)res)->ob_size =
|
|
||||||
((PyLongObject *)o)->ob_size;
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
if (PyString_Check(o))
|
if (PyString_Check(o))
|
||||||
/* need to do extra error checking that PyLong_FromString()
|
/* need to do extra error checking that PyLong_FromString()
|
||||||
* doesn't do. In particular long('9.5') must raise an
|
* doesn't do. In particular long('9.5') must raise an
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue