Issue #28998: More APIs now support longs as well as ints.
diff --git a/Modules/dlmodule.c b/Modules/dlmodule.c
index dfecf9d..7a6686e 100644
--- a/Modules/dlmodule.c
+++ b/Modules/dlmodule.c
@@ -107,8 +107,11 @@
}
for (i = 1; i < n; i++) {
PyObject *v = PyTuple_GetItem(args, i);
- if (PyInt_Check(v))
+ if (PyInt_Check(v) || PyLong_Check(v)) {
alist[i-1] = PyInt_AsLong(v);
+ if (alist[i-1] == -1 && PyErr_Occurred())
+ return NULL;
+ }
else if (PyString_Check(v))
alist[i-1] = (long)PyString_AsString(v);
else if (v == Py_None)