]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Replace deprecated PyEval_CallObject will PyObject_Call when build for python >= 3.0
authorMichael Schroeder <mls@suse.de>
Tue, 13 Feb 2024 15:02:50 +0000 (16:02 +0100)
committerMichael Schroeder <mls@suse.de>
Tue, 13 Feb 2024 15:05:50 +0000 (16:05 +0100)
Fixes issue #551

bindings/solv.i

index a51ae2be5da92139a63b21c8b3258d5084d22e0c..02831cf1bc1ac758e9dfa8d4fee53aef56028b65 100644 (file)
@@ -1729,7 +1729,12 @@ returnself(matchsolvable)
   SWIGINTERN int loadcallback(Pool *pool, Repodata *data, void *d) {
     XRepodata *xd = new_XRepodata(data->repo, data->repodataid);
     PyObject *args = Py_BuildValue("(O)", SWIG_NewPointerObj(SWIG_as_voidptr(xd), SWIGTYPE_p_XRepodata, SWIG_POINTER_OWN | 0));
+%#if PY_VERSION_HEX >= 0x03000000
+    PyObject *result = PyObject_Call((PyObject *)d, args, NULL);
+%#else
     PyObject *result = PyEval_CallObject((PyObject *)d, args);
+%#endif
+
     int ecode = 0;
     int vresult = 0;
     Py_DECREF(args);