summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/PythonDataObjects.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Interpreter/PythonDataObjects.cpp')
-rw-r--r--lldb/source/Interpreter/PythonDataObjects.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/lldb/source/Interpreter/PythonDataObjects.cpp b/lldb/source/Interpreter/PythonDataObjects.cpp
index 5b8ec527739..8cd4db999a7 100644
--- a/lldb/source/Interpreter/PythonDataObjects.cpp
+++ b/lldb/source/Interpreter/PythonDataObjects.cpp
@@ -316,8 +316,14 @@ PythonDictionary::GetItemForKeyAsInteger (const PythonString &key, int64_t fail_
if (m_py_obj && key)
{
PyObject *py_obj = PyDict_GetItem(m_py_obj, key.GetPythonObject());
- if (py_obj && PyInt_Check(py_obj))
- return PyInt_AsLong(py_obj);
+ if (py_obj)
+ {
+ if (PyInt_Check(py_obj))
+ return PyInt_AsLong(py_obj);
+
+ if (PyLong_Check(py_obj))
+ return PyLong_AsLong(py_obj);
+ }
}
return fail_value;
}
OpenPOWER on IntegriCloud