Description: Make work with Python 3.13

--- swiftlang-6.0.3.orig/llvm-project/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
+++ swiftlang-6.0.3/llvm-project/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
@@ -71,7 +71,9 @@ Expected<std::string> python::As<std::st
 }
 
 static bool python_is_finalizing() {
-#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION < 7
+#if (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 13) || (PY_MAJOR_VERSION > 3)
+  return Py_IsFinalizing();
+#elif PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION < 7
   return _Py_Finalizing != nullptr;
 #else
   return _Py_IsFinalizing();
--- swiftlang-6.0.3.orig/llvm-project/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ swiftlang-6.0.3/llvm-project/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -182,7 +182,7 @@ private:
       return;
 #endif
 
-    if (PyEval_ThreadsInitialized()) {
+    if (Py_IsInitialized()) {
       Log *log = GetLog(LLDBLog::Script);
 
       m_was_already_initialized = true;
@@ -191,9 +191,6 @@ private:
                 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;
