Skip to content

Commit

Permalink
Merge pull request #420 from llaniewski/fix/python
Browse files Browse the repository at this point in the history
Fixing depreciated python API
  • Loading branch information
llaniewski authored Dec 26, 2022
2 parents b277f80 + 3c47999 commit e11ef85
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 0 additions & 3 deletions src/Geometry.cpp.Rt
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions src/Handlers/cbPythonCall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e11ef85

Please sign in to comment.