diff options
author | Davide Italiano <davide@freebsd.org> | 2019-01-09 22:52:47 +0000 |
---|---|---|
committer | Davide Italiano <davide@freebsd.org> | 2019-01-09 22:52:47 +0000 |
commit | d9c6c2b57b1ba69c82972c3f1a4abae23082d6cc (patch) | |
tree | bcaee709ebaf7d034176b14e3e70315388bcc610 /lldb | |
parent | 76b640b8ca82ea84d8f19e3015aa758ea19c2eae (diff) |
[Python] Update PyString_FromString() to work for python 2 and 3.
Reviewers: aprantl, JDevlieghere, friss, zturner
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D56511
Diffstat (limited to 'lldb')
-rw-r--r-- | lldb/scripts/Python/python-swigsafecast.swig | 9 | ||||
-rw-r--r-- | lldb/scripts/Python/python-wrapper.swig | 4 |
2 files changed, 3 insertions, 10 deletions
diff --git a/lldb/scripts/Python/python-swigsafecast.swig b/lldb/scripts/Python/python-swigsafecast.swig index 57ae00c067d..d5cafbfa67c 100644 --- a/lldb/scripts/Python/python-swigsafecast.swig +++ b/lldb/scripts/Python/python-swigsafecast.swig @@ -27,15 +27,6 @@ SBTypeToSWIGWrapper (PyObject* py_object) template <> PyObject* -SBTypeToSWIGWrapper (const char* c_str) -{ - if (c_str) - return PyString_FromString(c_str); - return NULL; -} - -template <> -PyObject* SBTypeToSWIGWrapper (unsigned int* c_int) { if (!c_int) diff --git a/lldb/scripts/Python/python-wrapper.swig b/lldb/scripts/Python/python-wrapper.swig index e6a6b7afb8e..8509899df27 100644 --- a/lldb/scripts/Python/python-wrapper.swig +++ b/lldb/scripts/Python/python-wrapper.swig @@ -826,7 +826,9 @@ LLDBSwigPython_GetRecognizedArguments lldb::SBFrame frame_sb(frame_sp); PyObject *arg = SBTypeToSWIGWrapper(frame_sb); - PyObject* result = PyObject_CallMethodObjArgs(implementor, PyString_FromString(callee_name), arg, NULL); + PythonString str(callee_name); + PyObject* result = PyObject_CallMethodObjArgs(implementor, str.get(), arg, + NULL); return result; } |