diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2016-01-13 20:06:56 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2016-01-13 20:06:56 +0000 |
commit | 7fed546d1996271dabc7cf71d4d033125c4da4ee (patch) | |
tree | 2b6dc7dcb4a6380cb331aded15f5a81c0038e194 /scripts/Python | |
parent | 9e6d35490a6542f9c97607f93c2ef8ca8e03cbcc (diff) |
Notes
Diffstat (limited to 'scripts/Python')
-rw-r--r-- | scripts/Python/python-typemaps.swig | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/scripts/Python/python-typemaps.swig b/scripts/Python/python-typemaps.swig index ec9302a15cd79..9c4e5cecb3639 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<lldb::tid_t>(py_int.GetInteger()); + } + else + { + PyErr_SetString(PyExc_ValueError, "Expecting an integer"); + return nullptr; + } } %typemap(typecheck) char ** { |