mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Drop _PyLong_FitsInLong. Fixes #1666.
This commit is contained in:
parent
704b34d9e4
commit
8445104d7d
3 changed files with 36 additions and 35 deletions
|
@ -392,19 +392,6 @@ PyLong_AsLong(PyObject *obj)
|
|||
return result;
|
||||
}
|
||||
|
||||
int
|
||||
_PyLong_FitsInLong(PyObject *vv)
|
||||
{
|
||||
int size;
|
||||
if (!PyLong_CheckExact(vv)) {
|
||||
PyErr_BadInternalCall();
|
||||
return 0;
|
||||
}
|
||||
/* conservative estimate */
|
||||
size = Py_SIZE(vv);
|
||||
return -2 <= size && size <= 2;
|
||||
}
|
||||
|
||||
/* Get a Py_ssize_t from a long int object.
|
||||
Returns -1 and sets an error condition if overflow occurs. */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue