diff options
Diffstat (limited to 'lldb/scripts/Python')
-rw-r--r-- | lldb/scripts/Python/python-wrapper.swig | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/lldb/scripts/Python/python-wrapper.swig b/lldb/scripts/Python/python-wrapper.swig index 10bbf1be55b..af8ea65db89 100644 --- a/lldb/scripts/Python/python-wrapper.swig +++ b/lldb/scripts/Python/python-wrapper.swig @@ -919,28 +919,22 @@ LLDBSwigPythonCallCommandObject lldb::SBDebugger debugger_sb(debugger); lldb::SBExecutionContext exe_ctx_sb(exe_ctx_ref_sp); - bool retval = false; - - { - PyErr_Cleaner py_err_cleaner(true); - - PyCallable pfunc = PyCallable::FindWithMemberFunction(implementor,"__call__"); + PyErr_Cleaner py_err_cleaner(true); - if (!pfunc) - return NULL; + PyCallable pfunc = PyCallable::FindWithMemberFunction(implementor,"__call__"); - // pass the pointer-to cmd_retobj_sb or watch the underlying object disappear from under you - // see comment above for SBCommandReturnObjectReleaser for further details - PyObject* pvalue = NULL; + if (!pfunc) + return false; - pvalue = pfunc(debugger_sb, args, exe_ctx_sb, &cmd_retobj_sb); + // pass the pointer-to cmd_retobj_sb or watch the underlying object disappear from under you + // see comment above for SBCommandReturnObjectReleaser for further details + PyObject* pvalue = NULL; - Py_XDECREF (pvalue); + pvalue = pfunc(debugger_sb, args, exe_ctx_sb, &cmd_retobj_sb); - retval = true; - } + Py_XDECREF (pvalue); - return retval; + return true; } SWIGEXPORT void* |