summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/Python/buildSwigPython.py
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2014-08-02 07:11:22 +0000
committerZachary Turner <zturner@google.com>2014-08-02 07:11:22 +0000
commitfb903ab7d41417d8c49fbf5b587d8bde7e3c1fbb (patch)
treece9dabd3a38db5d5e9d59553d55705e7682ebefb /lldb/scripts/Python/buildSwigPython.py
parent090b78c7d2632fecc281d277c768c9818d99312f (diff)
downloadbcm5719-llvm-fb903ab7d41417d8c49fbf5b587d8bde7e3c1fbb.tar.gz
bcm5719-llvm-fb903ab7d41417d8c49fbf5b587d8bde7e3c1fbb.zip
Make the swig generation script use the correct python executable.
It was hardcoding the value "python", which will end up at best getting a different python executable (if the user has overridden the value of PYTHON_EXECUTABLE), and at worst encountering an error (if there is no copy of python on the system path). This patch changes the script to use sys.executable so that it runs the sub-script with the same executable that it was run with. llvm-svn: 214618
Diffstat (limited to 'lldb/scripts/Python/buildSwigPython.py')
-rw-r--r--lldb/scripts/Python/buildSwigPython.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lldb/scripts/Python/buildSwigPython.py b/lldb/scripts/Python/buildSwigPython.py
index 8cc3b771988..15129dc1165 100644
--- a/lldb/scripts/Python/buildSwigPython.py
+++ b/lldb/scripts/Python/buildSwigPython.py
@@ -26,6 +26,7 @@
# Python modules:
import os # Provide directory and file handling, determine OS information
+import sys # sys.executable
import time # Time access and conversions
import subprocess # Call external programs
import shutil # File handling
@@ -533,7 +534,7 @@ def run_python_script( vDictArgs, vstrArgs ):
strMsg = "";
bDbg = vDictArgs.has_key( "-d" );
- strPy = "python %s" % vstrArgs;
+ strPy = "%s %s" % (sys.executable, vstrArgs);
process = subprocess.Popen( strPy, shell=True );
strStdOut, strStdErr = process.communicate();
nResult = process.returncode;
OpenPOWER on IntegriCloud