diff options
author | Adam Casey <adamncasey@gmail.com> | 2016-01-23 12:15:51 +0000 |
---|---|---|
committer | Adam Casey <adamncasey@gmail.com> | 2016-01-23 15:04:34 +0000 |
commit | 25b0ee22f2ba8a419d528bc875d17a9776375cb3 (patch) | |
tree | 7f73e80ac0ed071e7457ce78cbe91f08e377e639 /python/mach_bootstrap.py | |
parent | 525e77f64fc65ea2397b4ff3849f5b1f39386698 (diff) | |
download | servo-25b0ee22f2ba8a419d528bc875d17a9776375cb3.tar.gz servo-25b0ee22f2ba8a419d528bc875d17a9776375cb3.zip |
Fix build on windows when default python is MSYS64 python
Diffstat (limited to 'python/mach_bootstrap.py')
-rw-r--r-- | python/mach_bootstrap.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/python/mach_bootstrap.py b/python/mach_bootstrap.py index e78132d21d2..a700b4c2419 100644 --- a/python/mach_bootstrap.py +++ b/python/mach_bootstrap.py @@ -80,6 +80,13 @@ def _get_exec(*names): return None +def _get_virtualenv_script_dir(): + # Virtualenv calls its scripts folder "bin" on linux/OSX/MSYS64 but "Scripts" on Windows + if os.name == "nt" and os.path.sep != "/": + return "Scripts" + return "bin" + + # Possible names of executables, sorted from most to least specific PYTHON_NAMES = ["python-2.7", "python2.7", "python2", "python"] VIRTUALENV_NAMES = ["virtualenv-2.7", "virtualenv2.7", "virtualenv2", "virtualenv"] @@ -92,8 +99,7 @@ def _activate_virtualenv(topdir): if python is None: sys.exit("Python is not installed. Please install it prior to running mach.") - # Virtualenv calls its scripts folder "bin" on linux/OSX but "Scripts" on Windows, detect which one then use that - script_dir = "Scripts" if os.name == "nt" else "bin" + script_dir = _get_virtualenv_script_dir() activate_path = os.path.join(virtualenv_path, script_dir, "activate_this.py") if not (os.path.exists(virtualenv_path) and os.path.exists(activate_path)): virtualenv = _get_exec(*VIRTUALENV_NAMES) |