summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/Python
diff options
context:
space:
mode:
authorDavide Italiano <davide@freebsd.org>2019-01-09 22:52:47 +0000
committerDavide Italiano <davide@freebsd.org>2019-01-09 22:52:47 +0000
commit8c2fe4797cbb137cd8e96a556f238dc728d438af (patch)
tree04e96a96a3c0eadfbddbc002a5c925e6d7e25c02 /lldb/scripts/Python
parent4e3c0bdf6fa7dbc1df282e36ea41f3dc9864a73c (diff)
downloadbcm5719-llvm-8c2fe4797cbb137cd8e96a556f238dc728d438af.tar.gz
bcm5719-llvm-8c2fe4797cbb137cd8e96a556f238dc728d438af.zip
[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 llvm-svn: 350769
Diffstat (limited to 'lldb/scripts/Python')
-rw-r--r--lldb/scripts/Python/python-swigsafecast.swig9
-rw-r--r--lldb/scripts/Python/python-wrapper.swig4
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;
}
OpenPOWER on IntegriCloud