wxPyBlock_t wxPyBeginBlockThreads() {
#ifdef WXP_WITH_THREAD
+ if (! Py_IsInitialized()) {
+ return (wxPyBlock_t)0;
+ }
#if wxPyUSE_GIL_STATE
PyGILState_STATE state = PyGILState_Ensure();
return state;
void wxPyEndBlockThreads(wxPyBlock_t blocked) {
#ifdef WXP_WITH_THREAD
+ if (! Py_IsInitialized()) {
+ return;
+ }
#if wxPyUSE_GIL_STATE
PyGILState_Release(blocked);
#else