Import threading on python context startup on main thread for debuggers

This commit is contained in:
baldurk
2024-07-15 16:22:38 +01:00
parent c9bb4ca4b8
commit d5cc1cf626
@@ -301,6 +301,13 @@ void PythonContext::GlobalInit()
PyErr_Clear();
}
// try to import threading library to make debuggers happier
if(!PyImport_ImportModule("threading"))
{
// ignore a failed import
PyErr_Clear();
}
// sysobj = sys
PyObject *sysobj = PyDict_GetItemString(main_dict, "sys");