Bug 1675675 - Only put mach_bootstrap paths in PYTHONPATH for mach python --no-virtualenv. r=firefox-build-system-reviewers,rstewart
With PYTHONPATH containing other directories, such as the python ones, bad things can happen when the python script that is being run then goes on to subprocess.Popen a python process for a different virtualenv, or a different version, or whatever. Differential Revision: https://phabricator.services.mozilla.com/D96155
This commit is contained in:
@@ -61,8 +61,10 @@ class MachCommands(MachCommandBase):
|
||||
}
|
||||
|
||||
if no_virtualenv:
|
||||
from mach_bootstrap import mach_sys_path
|
||||
|
||||
python_path = sys.executable
|
||||
append_env["PYTHONPATH"] = os.pathsep.join(sys.path)
|
||||
append_env["PYTHONPATH"] = os.pathsep.join(mach_sys_path(self.topsrcdir))
|
||||
else:
|
||||
self.activate_virtualenv()
|
||||
python_path = self.virtualenv_manager.python_path
|
||||
|
||||
Reference in New Issue
Block a user