[Lldb-commits] [lldb] [lldb] Support the Python stable C API in PythonString::AsUTF8 (PR #152599)

via lldb-commits lldb-commits at lists.llvm.org
Thu Aug 7 14:56:27 PDT 2025


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 HEAD~1 HEAD --extensions cpp -- lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
``````````

</details>

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

``````````diff
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
index cf8c22ff2..a2a287a67 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
@@ -413,9 +413,9 @@ Expected<llvm::StringRef> PythonString::AsUTF8() const {
 #if defined(Py_LIMITED_API) && (Py_LIMITED_API < 0x030a0000)
   PyObject *py_bytes = PyUnicode_AsUTF8String(m_py_obj);
   if (!py_bytes)
-      return exception();
+    return exception();
   auto release_py_str =
-        llvm::make_scope_exit([py_bytes] { Py_DECREF(py_bytes); });
+      llvm::make_scope_exit([py_bytes] { Py_DECREF(py_bytes); });
   Py_ssize_t size = PyBytes_Size(py_bytes);
   const char *str = PyBytes_AsString(py_bytes);
 

``````````

</details>


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


More information about the lldb-commits mailing list