diff options
Diffstat (limited to 'Objects/longobject.c')
| -rw-r--r-- | Objects/longobject.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Objects/longobject.c b/Objects/longobject.c index 8f7d9e4..be4af3f 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -679,7 +679,13 @@ PyLong_AsLongLong(PyObject *vv) int one = 1; int res; - if (vv == NULL || !PyLong_Check(vv)) { + if (vv == NULL) { + PyErr_BadInternalCall(); + return -1; + } + if (!PyLong_Check(vv)) { + if (PyInt_Check(vv)) + return (LONG_LONG)PyInt_AsLong(vv); PyErr_BadInternalCall(); return -1; } |
