diff --git a/extensions/python/xpcom/src/xpcom.cpp b/extensions/python/xpcom/src/xpcom.cpp index d20bc6ac2ce..449871d43f0 100644 --- a/extensions/python/xpcom/src/xpcom.cpp +++ b/extensions/python/xpcom/src/xpcom.cpp @@ -102,7 +102,9 @@ extern "C" NS_EXPORT nsresult PyXPCOM_NSGetModule(nsIComponentManager *servMgr, return NS_ERROR_FAILURE; } PyEval_InitThreads(); +#ifndef PYXPCOM_USE_PYGILSTATE PyXPCOM_InterpreterState_Ensure(); +#endif PyEval_SaveThread(); } #endif // LOADER_LINKS_WITH_PYTHON