From 3225b9f9739cd4bcca372d0fa939cea1ae5c6402 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 9 Mar 2020 20:56:57 +0100 Subject: 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. --- Programs/_testembed.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'Programs') diff --git a/Programs/_testembed.c b/Programs/_testembed.c index b98696cbe0..900a4b1d42 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!"); -- cgit v1.2.3-65-gdbad