Fix error messages not being printed from async python callbacks

This commit is contained in:
baldurk
2020-12-14 19:09:38 +00:00
parent 4bc795c344
commit 0163328884
+12 -1
View File
@@ -1293,7 +1293,18 @@ extern "C" PyThreadState *GetExecutingThreadState(PyObject *global_handle)
extern "C" PyObject *GetCurrentGlobalHandle()
{
return current_global_handle;
if(current_global_handle)
return current_global_handle;
PyObject *sys = PyImport_ImportModule("sys");
if(sys)
{
PyObject *ret = PyObject_GetAttrString(sys, "stdout");
Py_XDECREF(sys);
return ret;
}
return NULL;
}
extern "C" void HandleException(PyObject *global_handle)