[Lldb-commits] [lldb] [lldb] Use Py_InitializeFromConfig with Python >= 3.8 (NFC) (PR #114112)

via lldb-commits lldb-commits at lists.llvm.org
Tue Oct 29 11:28:25 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 2ab98dfe19ac384f0cfac1a1fafc56b9dd7ad9b7 c58438160c016841c6a72e53cd5c4985ebd1e521 --extensions cpp -- lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
index d7734c5e19..cde1e707cd 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -149,10 +149,10 @@ public:
     }
 
 #if (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 8) || (PY_MAJOR_VERSION > 3)
-  config.install_signal_handlers = 0;
-  Py_InitializeFromConfig(&config);
-  PyConfig_Clear(&config);
-  InitializeThreadsPrivate();
+    config.install_signal_handlers = 0;
+    Py_InitializeFromConfig(&config);
+    PyConfig_Clear(&config);
+    InitializeThreadsPrivate();
 #else
 // Python < 3.2 and Python >= 3.2 reversed the ordering requirements for
 // calling `Py_Initialize` and `PyEval_InitThreads`.  < 3.2 requires that you
@@ -180,7 +180,6 @@ public:
   }
 
 private:
-
   void InitializeThreadsPrivate() {
 // Since Python 3.7 `Py_Initialize` calls `PyEval_InitThreads` inside itself,
 // so there is no way to determine whether the embedded interpreter

``````````

</details>


https://github.com/llvm/llvm-project/pull/114112


More information about the lldb-commits mailing list