[Lldb-commits] [lldb] [lldb] Reimplment PyRun_String using the Python stable C API (PR #151761)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Mon Aug 4 02:34:23 PDT 2025
================
@@ -1469,11 +1466,33 @@ python::runStringMultiLine(const llvm::Twine &string,
const PythonDictionary &locals) {
if (!globals.IsValid() || !locals.IsValid())
return nullDeref();
- PyObject *result = PyRun_String(NullTerminated(string), Py_file_input,
- globals.get(), locals.get());
+ PyObject *result = RunString(NullTerminated(string), Py_file_input,
+ globals.get(), locals.get());
if (!result)
return exception();
return Take<PythonObject>(result);
}
+namespace lldb_private {
+namespace python {
----------------
labath wrote:
Opening the namespace halfway through the file looks weird.
In most of other places we use the syntax suggested by Alex. We also have some files which place the entire contents of the file inside the namespace. I think that looks less weird, and it is a style preferred by some style guides. However, I would argue that is not consistent with the llvm "make namespaces as small as possible" rule.
https://github.com/llvm/llvm-project/pull/151761
More information about the lldb-commits
mailing list