From 478619cf9a24ad8eac806959ca6a289a9beb71ae Mon Sep 17 00:00:00 2001 From: Muhammad Omair Javaid Date: Thu, 23 Apr 2020 04:35:30 +0500 Subject: Revert "get rid of PythonInteger::GetInteger()" This reverts commit 7375212172951d2fc283c81d03c1a8588c3280c6. This causes multiple test failures on LLDB AArch64 Linux buildbot. http://lab.llvm.org:8011/builders/lldb-aarch64-ubuntu/builds/3695 Differential Revision: https://reviews.llvm.org/D78462 --- .../ScriptInterpreter/Python/ScriptInterpreterPython.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp') diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp index 6f26677..c53b3bd 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp @@ -3150,15 +3150,20 @@ uint32_t ScriptInterpreterPythonImpl::GetFlagsForCommandObject( if (PyErr_Occurred()) PyErr_Clear(); - long long py_return = unwrapOrSetPythonException( - As(implementor.CallMethod(callee_name))); + // right now we know this function exists and is callable.. + PythonObject py_return( + PyRefType::Owned, + PyObject_CallMethod(implementor.get(), callee_name, nullptr)); // if it fails, print the error but otherwise go on if (PyErr_Occurred()) { PyErr_Print(); PyErr_Clear(); - } else { - result = py_return; + } + + if (py_return.IsAllocated() && PythonInteger::Check(py_return.get())) { + PythonInteger int_value(PyRefType::Borrowed, py_return.get()); + result = int_value.GetInteger(); } return result; -- cgit v1.1