aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-03-09 20:56:57 +0100
committerGitHub <noreply@github.com>2020-03-09 20:56:57 +0100
commit3225b9f9739cd4bcca372d0fa939cea1ae5c6402 (patch)
tree008faa6d058d9f9e449bf2113287aa5e30c8a35f /Programs
parentbpo-38249: Expand Py_UNREACHABLE() to __builtin_unreachable() in the release ... (diff)
downloadcpython-3225b9f9739cd4bcca372d0fa939cea1ae5c6402.tar.gz
cpython-3225b9f9739cd4bcca372d0fa939cea1ae5c6402.tar.bz2
cpython-3225b9f9739cd4bcca372d0fa939cea1ae5c6402.zip
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 'Programs')
-rw-r--r--Programs/_testembed.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/Programs/_testembed.c b/Programs/_testembed.c
index b98696cbe03..900a4b1d427 100644
--- a/Programs/_testembed.c
+++ b/Programs/_testembed.c
@@ -62,7 +62,6 @@ static int test_repeated_init_and_subinterpreters(void)
_testembed_Py_Initialize();
mainstate = PyThreadState_Get();
- PyEval_InitThreads();
PyEval_ReleaseThread(mainstate);
gilstate = PyGILState_Ensure();
@@ -252,9 +251,8 @@ static int test_bpo20891(void)
/* the test doesn't support custom memory allocators */
putenv("PYTHONMALLOC=");
- /* bpo-20891: Calling PyGILState_Ensure in a non-Python thread before
- calling PyEval_InitThreads() must not crash. PyGILState_Ensure() must
- call PyEval_InitThreads() for us in this case. */
+ /* bpo-20891: Calling PyGILState_Ensure in a non-Python thread must not
+ crash. */
PyThread_type_lock lock = PyThread_allocate_lock();
if (!lock) {
fprintf(stderr, "PyThread_allocate_lock failed!");