diff --git a/PyScModule.cpp b/PyScModule.cpp index 948f36c..f574e9f 100644 --- a/PyScModule.cpp +++ b/PyScModule.cpp @@ -20,8 +20,12 @@ scc::PyScModule::PyScModule(PyObject* self, const sc_core::sc_module_name& nm) : sc_core::sc_module(nm) , self(self) { - if (! PyEval_ThreadsInitialized()) +#if PY_VERSION_HEX < 0x03090000 + if (!PyEval_ThreadsInitialized()) PyEval_InitThreads(); +#else + PyEval_InitThreads(); +#endif Py_INCREF(self); }