From 8553c19974a5ab5f815b9e64f7bfe9899924726b Mon Sep 17 00:00:00 2001 From: dim Date: Wed, 13 Jan 2016 20:06:56 +0000 Subject: Vendor import of lldb trunk r257626: https://llvm.org/svn/llvm-project/lldb/trunk@257626 --- scripts/Python/python-typemaps.swig | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'scripts/Python/python-typemaps.swig') diff --git a/scripts/Python/python-typemaps.swig b/scripts/Python/python-typemaps.swig index ec9302a..9c4e5ce 100644 --- a/scripts/Python/python-typemaps.swig +++ b/scripts/Python/python-typemaps.swig @@ -26,15 +26,17 @@ } %typemap(in) lldb::tid_t { - if (PyInt_Check($input)) - $1 = PyInt_AsLong($input); - else if (PyLong_Check($input)) - $1 = PyLong_AsLongLong($input); - else - { - PyErr_SetString(PyExc_ValueError, "Expecting an integer"); - return NULL; - } + using namespace lldb_private; + if (PythonInteger::Check($input)) + { + PythonInteger py_int(PyRefType::Borrowed, $input); + $1 = static_cast(py_int.GetInteger()); + } + else + { + PyErr_SetString(PyExc_ValueError, "Expecting an integer"); + return nullptr; + } } %typemap(typecheck) char ** { -- cgit v1.1