[libxslt] Migrate from PyEval_ to PyObject_
- From: Nick Wellnhofer <nwellnhof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libxslt] Migrate from PyEval_ to PyObject_
- Date: Mon, 29 Aug 2022 15:30:55 +0000 (UTC)
commit 43e3b41defefc4ecfbecc099692ba97d1c5b2e97
Author: Nick Wellnhofer <wellnhofer aevum de>
Date: Mon Aug 29 17:23:08 2022 +0200
Migrate from PyEval_ to PyObject_
PyEval_ functions are deprecated.
.gitlab-ci.yml | 3 +--
python/libxslt.c | 8 ++++----
2 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d4af61c8..2ca5355b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -27,8 +27,7 @@ gcc:
gcc:python3:
extends: .test
variables:
- # TODO: Re-enable the warning after libxml2 #208 is fixed.
- CFLAGS: "-O2 -Wno-error=deprecated-declarations"
+ CFLAGS: "-O2"
PYTHON: "/usr/bin/python3"
gcc:static:
diff --git a/python/libxslt.c b/python/libxslt.c
index 0758d606..0e2786ce 100644
--- a/python/libxslt.c
+++ b/python/libxslt.c
@@ -299,7 +299,7 @@ libxslt_xsltElementPreCompCallback(xsltStylesheetPtr style, xmlNodePtr inst,
pyobj_element_f);
Py_INCREF(pyobj_precomp_f); /* Protect refcount against reentrant manipulation of callback hash */
- result = PyEval_CallObject(pyobj_precomp_f, args);
+ result = PyObject_CallObject(pyobj_precomp_f, args);
Py_DECREF(pyobj_precomp_f);
Py_DECREF(args);
@@ -357,7 +357,7 @@ libxslt_xsltElementTransformCallback(xsltTransformContextPtr ctxt,
libxslt_xsltElemPreCompPtrWrap(comp));
Py_INCREF(func); /* Protect refcount against reentrant manipulation of callback hash */
- result = PyEval_CallObject(func, args);
+ result = PyObject_CallObject(func, args);
Py_DECREF(func);
Py_DECREF(args);
@@ -468,7 +468,7 @@ libxslt_xmlXPathFuncCallback(xmlXPathParserContextPtr ctxt, int nargs) {
}
Py_INCREF(current_function);
- result = PyEval_CallObject(current_function, list);
+ result = PyObject_CallObject(current_function, list);
Py_DECREF(current_function);
Py_DECREF(list);
@@ -961,7 +961,7 @@ libxslt_xsltErrorFuncHandler(void *ctx ATTRIBUTE_UNUSED, const char *msg,
Py_XINCREF(libxslt_xsltPythonErrorFuncCtxt);
message = libxml_charPtrWrap(str);
PyTuple_SetItem(list, 1, message);
- result = PyEval_CallObject(libxslt_xsltPythonErrorFuncHandler, list);
+ result = PyObject_CallObject(libxslt_xsltPythonErrorFuncHandler, list);
Py_XDECREF(list);
Py_XDECREF(result);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]