diff options
author | Victor Stinner <vstinner@python.org> | 2020-03-09 19:56:57 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-09 19:56:57 (GMT) |
commit | 3225b9f9739cd4bcca372d0fa939cea1ae5c6402 (patch) | |
tree | 008faa6d058d9f9e449bf2113287aa5e30c8a35f /Python | |
parent | eebaa9bfc593d5a46b293c1abd929fbfbfd28199 (diff) | |
download | cpython-3225b9f9739cd4bcca372d0fa939cea1ae5c6402.zip cpython-3225b9f9739cd4bcca372d0fa939cea1ae5c6402.tar.gz cpython-3225b9f9739cd4bcca372d0fa939cea1ae5c6402.tar.bz2 |
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.
Diffstat (limited to 'Python')
-rw-r--r-- | Python/ceval.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 42f08c4..26cefead 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -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; } |