[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:18:59 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB356816: [ScriptInterpreter] Make sure that PYTHONHOME is right. (authored by davide, committed by ).
Herald added a project: LLDB.

Changed prior to commit:
  https://reviews.llvm.org/D59719?vs=191958&id=191959#toc

Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D59719

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


Index: source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
===================================================================
--- source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -177,6 +177,16 @@
 #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
   }
 
   void InitializeThreadsPrivate() {


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


More information about the lldb-commits mailing list