diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2017-11-22 00:47:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-22 00:47:20 +0200 |
commit | d882b6fbd466940d452cfaa890bd9270e10a93b4 (patch) | |
tree | d1ed9d893da50afb4ed3e6f031da91949f1d67ee /mesonbuild/environment.py | |
parent | fdb48a3a0f0425a6bd4a71a2e004479080955df8 (diff) | |
parent | f9e88cd37e6babc1de476398f54a540f3eeca1c7 (diff) | |
download | meson-d882b6fbd466940d452cfaa890bd9270e10a93b4.zip meson-d882b6fbd466940d452cfaa890bd9270e10a93b4.tar.gz meson-d882b6fbd466940d452cfaa890bd9270e10a93b4.tar.bz2 |
Merge pull request #2498 from mesonbuild/runpython
Add possibility to run Python scripts with current interpreter
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r-- | mesonbuild/environment.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index d9146eb..58cc9b9 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -325,14 +325,10 @@ class Environment: return self.coredata def get_build_command(self, unbuffered=False): - # If running an executable created with cx_freeze, - # Python might not be installed so don't prefix - # the command with it. - if sys.executable.endswith('meson.exe'): - return [sys.executable] - if unbuffered: - [sys.executable, '-u', self.meson_script_launcher] - return [sys.executable, self.meson_script_launcher] + cmd = mesonlib.meson_command[:] + if unbuffered and 'python' in cmd[0]: + cmd.insert(1, '-u') + return cmd def is_header(self, fname): return is_header(fname) |