Skip to content

Commit

Permalink
Don't call PyEval_InitThreads() on Python 3.7+ (#132)
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

Since pyotherside requires Python 3.8, simply remove the call.
  • Loading branch information
vstinner authored May 31, 2024
1 parent 9a4d1a2 commit 4fa3406
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 7 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ The image provider must return a tuple ``(data, size, format)``:
The pixel format of ``data`` (see `constants`_),
``pyotherside.format_data`` if ``data`` contains an
encoded (PNG/JPEG) image instead of raw pixel data
or ``pyotherside.format_svg_data`` if ``data`` contains
or ``pyotherside.format_svg_data`` if ``data`` contains
SVG image XML data.

In order to register the image provider with PyOtherSide for use
Expand Down Expand Up @@ -1196,6 +1196,12 @@ flags for compiling and linking against Python on your system.
ChangeLog
=========

Version UNRELEASED
------------------

* No longer call PyEval_InitThreads() at Python startup. It's no longer needed
since Python 3.7.

Version 1.6.1 (2024-05-18)
--------------------------

Expand Down
1 change: 0 additions & 1 deletion src/qpython_priv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,6 @@ QPythonPriv::QPythonPriv()
PyImport_AppendInittab("pyotherside", PyOtherSide_init);

Py_InitializeEx(0);
PyEval_InitThreads();

// Initialize sys.argv (https://github.com/thp/pyotherside/issues/77)
int argc = 1;
Expand Down

0 comments on commit 4fa3406

Please sign in to comment.