Skip to content

Commit 7d92b8c

Browse files
ader1990petrutlucian94
authored andcommitted
python_3.13: use Py_(Is)Initialize(d) instead of (Is)PyEval_InitThreads
See: https://docs.python.org/3.9/c-api/init.html#c.PyEval_ThreadsInitialized ``` Returns a non-zero value if PyEval_InitThreads() has been called. This function can be called without holding the GIL, and therefore can be used to avoid calls to the locking API when running single-threaded. Changed in version 3.7: The GIL is now initialized by Py_Initialize(). Deprecated since version 3.9, will be removed in version 3.11. ```
1 parent 2ad91a4 commit 7d92b8c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

PyMI/PyMI.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ static PyModuleDef mimodule = {
3434

3535
PyObject* _initmi(void)
3636
{
37-
if (!PyEval_ThreadsInitialized())
37+
if (!Py_IsInitialized())
3838
{
39-
PyEval_InitThreads();
39+
Py_Initialize();
4040
}
4141

4242
PyDateTime_IMPORT;

0 commit comments

Comments
 (0)