[Lldb-commits] [lldb] [lldb] Set return status to Failed when Python command raises uncaught exception (PR #113996)

Dave Lee via lldb-commits lldb-commits at lists.llvm.org
Sun Nov 24 17:24:18 PST 2024


================
@@ -642,6 +649,16 @@ bool lldb_private::python::SWIGBridge::LLDBSwigPythonCallCommandObject(
   pfunc(SWIGBridge::ToSWIGWrapper(std::move(debugger)), PythonString(args),
         SWIGBridge::ToSWIGWrapper(exe_ctx_ref_sp), cmd_retobj_arg.obj());
 
+  if (PyErr_Occurred()) {
+    py_err_cleaner.~PyErr_Cleaner();
----------------
kastiglione wrote:

I replaced the explicit destructor call.

The change to `PythonCallable::operator()` sounds good, but looks like a wide ranging change. I'll set that aside for a future change.

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


More information about the lldb-commits mailing list