Revert "get rid of PythonInteger::GetInteger()"

This reverts commit 7375212172.

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
This commit is contained in:
Muhammad Omair Javaid
2020-04-23 04:35:30 +05:00
parent 328bb446dd
commit 478619cf9a
6 changed files with 120 additions and 117 deletions

View File

@@ -3150,15 +3150,20 @@ uint32_t ScriptInterpreterPythonImpl::GetFlagsForCommandObject(
if (PyErr_Occurred())
PyErr_Clear();
long long py_return = unwrapOrSetPythonException(
As<long long>(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;