This revision was automatically updated to reflect the committed changes.
Closed by commit rL350769: [Python] Update PyString_FromString() to work for 
python 2 and 3. (authored by davide, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D56511?vs=180924&id=180938#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56511/new/

https://reviews.llvm.org/D56511

Files:
  lldb/trunk/scripts/Python/python-swigsafecast.swig
  lldb/trunk/scripts/Python/python-wrapper.swig


Index: lldb/trunk/scripts/Python/python-swigsafecast.swig
===================================================================
--- lldb/trunk/scripts/Python/python-swigsafecast.swig
+++ lldb/trunk/scripts/Python/python-swigsafecast.swig
@@ -27,15 +27,6 @@
 
 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)
Index: lldb/trunk/scripts/Python/python-wrapper.swig
===================================================================
--- lldb/trunk/scripts/Python/python-wrapper.swig
+++ lldb/trunk/scripts/Python/python-wrapper.swig
@@ -826,7 +826,9 @@
     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;
 }
 


Index: lldb/trunk/scripts/Python/python-swigsafecast.swig
===================================================================
--- lldb/trunk/scripts/Python/python-swigsafecast.swig
+++ lldb/trunk/scripts/Python/python-swigsafecast.swig
@@ -27,15 +27,6 @@
 
 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)
Index: lldb/trunk/scripts/Python/python-wrapper.swig
===================================================================
--- lldb/trunk/scripts/Python/python-wrapper.swig
+++ lldb/trunk/scripts/Python/python-wrapper.swig
@@ -826,7 +826,9 @@
     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;
 }
 
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to