Porting Py3.8/Py3.9:
Since Py3.3: 'Py_ssize_t PyUnicode_GetSize(PyObject*)' is deprecated [-Wdeprecated-declarations] Since Py3.9: 'PyObject* PyEval_CallObjectWithKeywords(PyObject*, PyObject*, PyObject*)' is deprecated [-Wdeprecated-declarations] Since Py3.9: 'void PyEval_InitThreads()' is deprecated [-Wdeprecated-declarations]
This commit is contained in:
@@ -549,7 +549,11 @@ const char* InterpreterSingleton::init(int argc,char *argv[])
|
||||
" exec(open(activate_this).read(), {'__file__':activate_this})\n"
|
||||
);
|
||||
}
|
||||
|
||||
#if PY_VERSION_HEX < 0x03090000
|
||||
PyEval_InitThreads();
|
||||
#endif
|
||||
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
size_t size = argc;
|
||||
wchar_t **_argv = new wchar_t*[size];
|
||||
@@ -700,7 +704,11 @@ void InterpreterSingleton::runMethod(PyObject *pobject, const char *method,
|
||||
throw TypeError("InterpreterSingleton::RunMethod() wrong arguments");
|
||||
}
|
||||
|
||||
#if PY_VERSION_HEX < 0x03090000
|
||||
presult = PyEval_CallObject(pmeth, pargs); /* run interpreter */
|
||||
#else
|
||||
presult = PyObject_CallObject(pmeth, pargs); /* run interpreter */
|
||||
#endif
|
||||
|
||||
Py_DECREF(pmeth);
|
||||
Py_DECREF(pargs);
|
||||
|
||||
Reference in New Issue
Block a user