mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-09-06 18:07:41 +02:00
- Fix for Python 3.9, no longer use deprecated functions of
PyEval_CallObject (now PyObject_Call), PyEval_InitThreads (now none), PyParser_SimpleParseFile (now Py_CompileString).
This commit is contained in:
@@ -916,7 +916,13 @@ int _ub_resolve_async(struct ub_ctx* ctx, char* name, int rrtype, int rrclass, v
|
||||
struct cb_data* id;
|
||||
id = (struct cb_data*) iddata;
|
||||
arglist = Py_BuildValue("(OiO)",id->data,status, SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ub_result, 0 | 0 )); // Build argument list
|
||||
#if PY_MAJOR_VERSION <= 2 || (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION < 9)
|
||||
/* for python before 3.9 */
|
||||
fresult = PyEval_CallObject(id->func,arglist); // Call Python
|
||||
#else
|
||||
/* for python 3.9 and newer */
|
||||
fresult = PyObject_Call(id->func,arglist,NULL);
|
||||
#endif
|
||||
Py_DECREF(id->func);
|
||||
Py_DECREF(id->data);
|
||||
free(id);
|
||||
|
||||
Reference in New Issue
Block a user