From 3c47999ddfa276aec4ee2b001dfb3f8eeff40f4a Mon Sep 17 00:00:00 2001 From: L Laniewski-Wollk Date: Mon, 26 Dec 2022 23:38:00 +1000 Subject: [PATCH] Fixing depreciated python API --- src/Geometry.cpp.Rt | 3 --- src/Handlers/cbPythonCall.cpp | 5 +++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Geometry.cpp.Rt b/src/Geometry.cpp.Rt index d2f0c22fd..79c8968a1 100644 --- a/src/Geometry.cpp.Rt +++ b/src/Geometry.cpp.Rt @@ -1074,9 +1074,6 @@ int Geometry::Draw(pugi::xml_node & node) } // Make sure the GIL has been created since we need to acquire it in our // callback to safely call into the python application. - if (! PyEval_ThreadsInitialized()) { - PyEval_InitThreads(); - } PyObject *pGlobal; PyObject* pyModule, *pLocal, *pValue; diff --git a/src/Handlers/cbPythonCall.cpp b/src/Handlers/cbPythonCall.cpp index 1e6bc8f64..9ca46392c 100644 --- a/src/Handlers/cbPythonCall.cpp +++ b/src/Handlers/cbPythonCall.cpp @@ -183,9 +183,10 @@ int cbPythonCall::DoIt () { } else { - if (PyErr_Occurred()) + if (PyErr_Occurred()) { PyErr_Print(); - error("PythonCall: Cannot find function \"%s\"\n", function.value()); + error("PythonCall: Cannot find function \"%s\"\n", function.value()); + } } Py_XDECREF(pFunc); Py_DECREF(pModule);