From 5b24c6fe097c2ca998d0a75fa3be2d6017d05508 Mon Sep 17 00:00:00 2001 From: Marius Gedminas Date: Tue, 26 Mar 2019 15:36:18 +0200 Subject: [PATCH] Use Py_ssize_t for length arguments of PyObject_CallFunction This API was introduced in Python 2.5 and the old one (using ints) has been deprecated since Python 3.8. See #108. --- persistent/cPersistence.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/persistent/cPersistence.c b/persistent/cPersistence.c index 285361e..d8d2885 100644 --- a/persistent/cPersistence.c +++ b/persistent/cPersistence.c @@ -16,6 +16,7 @@ static char cPersistence_doc_string[] = "\n" "$Id$\n"; +#define PY_SSIZE_T_CLEAN #include "cPersistence.h" #include "structmember.h" @@ -1268,9 +1269,9 @@ Per_get_mtime(cPersistentObject *self) } #ifdef PY3K - t = PyObject_CallFunction(TimeStamp, "y#", self->serial, 8); + t = PyObject_CallFunction(TimeStamp, "y#", self->serial, (Py_ssize_t)8); #else - t = PyObject_CallFunction(TimeStamp, "s#", self->serial, 8); + t = PyObject_CallFunction(TimeStamp, "s#", self->serial, (Py_ssize_t)8); #endif if (!t) {