]> git.ipfire.org Git - pakfire.git/commitdiff
_pakfire: Fix deprecation warning for PyBuildValue that uses #
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 8 Dec 2021 16:11:19 +0000 (16:11 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 8 Dec 2021 16:11:19 +0000 (16:11 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/_pakfire/pakfire.c

index 9c4401d3ee65ab1070fb89afdb9eb41bb76c1914..c6c2419ad834c000cecfd631a36fdf16bf86fc37 100644 (file)
@@ -18,6 +18,7 @@
 #                                                                             #
 #############################################################################*/
 
+#define PY_SSIZE_T_CLEAN
 #include <Python.h>
 #include <errno.h>
 
@@ -674,7 +675,7 @@ static int __Pakfire_execute_logging_callback(struct pakfire* pakfire, void* dat
                length--;
 
        // Create tuple with arguments for the callback function
-       PyObject* args = Py_BuildValue("(is#)", priority, line, length);
+       PyObject* args = Py_BuildValue("(is#)", priority, line, (Py_ssize_t)length);
        if (!args)
                return 1;