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.
This commit is contained in:
Victor Stinner 2020-03-09 20:56:57 +01:00 committed by GitHub
parent eebaa9bfc5
commit 3225b9f973
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 7 additions and 21 deletions

View file

@ -345,7 +345,7 @@ PyEval_AcquireThread(PyThreadState *tstate)
_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 @@ Py_AddPendingCall(int (*func)(void *), void *arg)
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;
}