[PATCH] D42950: LLDB fails to build

Stanislav Kaliev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 6 01:24:38 PST 2018


stanblesk created this revision.
Herald added a subscriber: llvm-commits.

Linux environment where Python 3 exists, and even if it's not set as default script uses Python 3 instead of Python 2.

Tested in Gentoo Linux

I don't knoe how to commit here, tried on github, but there is a read-only version of code there


Repository:
  rL LLVM

https://reviews.llvm.org/D42950

Files:
  scripts/Python/python-swigsafecast.swig


Index: scripts/Python/python-swigsafecast.swig
===================================================================
--- scripts/Python/python-swigsafecast.swig
+++ scripts/Python/python-swigsafecast.swig
@@ -30,7 +30,11 @@
 SBTypeToSWIGWrapper (const char* c_str)
 {
     if (c_str)
-        return PyString_FromString(c_str);
+        #if PY_MAJOR_VERSION > 2
+            return PyUnicode_FromString(c_str);
+        #else
+            return PyString_FromString(c_str);
+        #endif
     return NULL;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42950.132954.patch
Type: text/x-patch
Size: 511 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180206/e38bf49c/attachment.bin>


More information about the llvm-commits mailing list