diff --git a/_imagingmath.c b/_imagingmath.c index 4f377e9ac..d97c7b405 100644 --- a/_imagingmath.c +++ b/_imagingmath.c @@ -222,7 +222,7 @@ static PyMethodDef _functions[] = { static void install(PyObject *d, char* name, void* value) { - PyObject *v = PyInt_FromLong((long) value); + PyObject *v = PyInt_FromSsize_t((Py_ssize_t) value); if (!v || PyDict_SetItemString(d, name, v)) PyErr_Clear(); Py_XDECREF(v);