diff options
author | Davide Italiano <davide@freebsd.org> | 2019-03-22 22:19:57 +0000 |
---|---|---|
committer | Davide Italiano <davide@freebsd.org> | 2019-03-22 22:19:57 +0000 |
commit | 386f00db75f1b6484329f14a7002e2c0fadadb76 (patch) | |
tree | b6f3ef6fe4e5f68b12466ddaf826767bf5735400 /lldb/source/Plugins/ScriptInterpreter/Python | |
parent | 74d5b3322235e72d951f45aa427443b2addcb931 (diff) | |
download | bcm5719-llvm-386f00db75f1b6484329f14a7002e2c0fadadb76.tar.gz bcm5719-llvm-386f00db75f1b6484329f14a7002e2c0fadadb76.zip |
[ScriptInterpreter] Make sure that PYTHONHOME is right.
Summary:
For the only version of Python actually supported on Darwin.
<rdar://problem/40961425>
Reviewers: jingham, friss, JDevlieghere, aprantl, jasonmolenda
Subscribers: jdoerfert, llvm-commits, lldb-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59719
llvm-svn: 356816
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python')
-rw-r--r-- | lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp index 543b8897b3f..d17a53b201f 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp @@ -177,6 +177,16 @@ private: #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() { |