From 4f8cb18f845df34320c9cf1dced779fe5f2f858a Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 16 Apr 2024 13:54:18 +0200 Subject: [PATCH] Don't call PyEval_InitThreads() on Python 3.7+ Since Python 3.7, the function does nothing. Moreover, it's deprecated since Python 3.9: https://docs.python.org/3.12/c-api/init.html#c.PyEval_InitThreads --- src/qpython_priv.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/qpython_priv.cpp b/src/qpython_priv.cpp index 687f9e4..efe1b51 100644 --- a/src/qpython_priv.cpp +++ b/src/qpython_priv.cpp @@ -532,7 +532,9 @@ QPythonPriv::QPythonPriv() PyImport_AppendInittab("pyotherside", PyOtherSide_init); Py_InitializeEx(0); +#if PY_VERSION_HEX < 0x03070000 PyEval_InitThreads(); +#endif // Initialize sys.argv (https://github.com/thp/pyotherside/issues/77) int argc = 1;