Skip to content

Commit

Permalink
Don't call PyEval_InitThreads() on Python 3.7+
Browse files Browse the repository at this point in the history
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
  • Loading branch information
vstinner committed Apr 16, 2024
1 parent 45c6cee commit 4f8cb18
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/qpython_priv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4f8cb18

Please sign in to comment.