diff --color -Naur llvm-project-orig/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp llvm-project/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp --- llvm-project-orig/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp 2024-09-19 10:08:49.705575598 -0500 +++ llvm-project/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp 2024-09-19 10:10:32.912369606 -0500 @@ -76,7 +76,7 @@ #elif PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION < 7 return _Py_Finalizing != nullptr; #else - return _Py_IsFinalizing(); + return Py_IsFinalizing(); #endif } diff --color -Naur llvm-project-orig/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp llvm-project/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp --- llvm-project-orig/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp 2024-09-19 10:08:49.706575663 -0500 +++ llvm-project/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp 2024-09-19 10:12:11.357850178 -0500 @@ -201,7 +201,7 @@ return; #endif - if (PyEval_ThreadsInitialized()) { + if (Py_IsInitialized()) { Log *log = GetLog(LLDBLog::Script); m_was_already_initialized = true; @@ -210,9 +210,6 @@ m_gil_state == PyGILState_UNLOCKED ? "un" : ""); return; } - - // InitThreads acquires the GIL if it hasn't been called before. - PyEval_InitThreads(); } PyGILState_STATE m_gil_state = PyGILState_UNLOCKED;