[Lldb-commits] [PATCH] D59719: [ScriptInterpreter] Make sure that PYTHONHOME is right.

Davide Italiano via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Mar 22 15:17:30 PDT 2019


davide updated this revision to Diff 191958.
davide added a comment.

Adrian's feedback


Repository:
  rL LLVM

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

https://reviews.llvm.org/D59719

Files:
  lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp


Index: lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
===================================================================
--- lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -176,6 +176,16 @@
     static char g_python_home[] = LLDB_PYTHON_HOME;
 #endif
     Py_SetPythonHome(g_python_home);
+#endif
+#else
+#if defined(__APPLE__) && PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION == 7
+    // For Darwin, the only Python version supported is the one shipped in the OS
+    // and linked with lldb. Other installation of Python may have higher priorities
+    // in the path, overriding PYTHONHOME and causing problems/incompatibilities.
+    // In order to avoid confusion, always hardcode the PythonHome to be right,
+    // as it's not going to change.
+    Py_SetPythonHome("/System/Library/Frameworks/Python.framework/Versions/2.7");
+#endif
 #endif
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59719.191958.patch
Type: text/x-patch
Size: 987 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190322/442a3854/attachment-0001.bin>


More information about the lldb-commits mailing list