bpo-39877: Remove useless PyEval_InitThreads() calls (GH-18883)
Py_Initialize() calls PyEval_InitThreads() since Python 3.7. It's no
longer needed to call it explicitly.
diff --git a/Python/ceval.c b/Python/ceval.c
index 42f08c4..26cefea 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -345,7 +345,7 @@
_PyRuntimeState *runtime = tstate->interp->runtime;
struct _ceval_runtime_state *ceval = &runtime->ceval;
- /* Check someone has called PyEval_InitThreads() to create the lock */
+ /* Check that _PyEval_InitThreads() was called to create the lock */
assert(gil_created(&ceval->gil));
take_gil(ceval, tstate);
@@ -541,9 +541,7 @@
static int
handle_signals(_PyRuntimeState *runtime)
{
- /* Only handle signals on main thread. PyEval_InitThreads must
- * have been called already.
- */
+ /* Only handle signals on main thread */
if (PyThread_get_thread_ident() != runtime->main_thread) {
return 0;
}