Chromium Code Reviews| Index: vpython/run.go |
| diff --git a/vpython/run.go b/vpython/run.go |
| index b817f1cbc46f248df972e4df3d8fa2403cd5c3db..85d42ffe97ba133d67bffe7e00c674d1d84226bf 100644 |
| --- a/vpython/run.go |
| +++ b/vpython/run.go |
| @@ -66,6 +66,14 @@ func Run(c context.Context, opts Options) error { |
| e = environ.System() |
| } |
| + // Remove PYTHONPATH and PYTHONHOME from the environment. This prevents them |
| + // from being propagated to delegate processes (e.g., "vpython" script calls |
| + // Python script, the "vpython" one uses the Interpreter's IsolatedCommand |
| + // to isolate the initial run, but the delegate command blindly uses the |
| + // environment that it's provided). |
| + e.Remove("PYTHONPATH") |
| + e.Remove("PYTHONHOME") |
|
iannucci
2017/05/08 18:59:08
what about site path stuff? or do these cover that
dnj
2017/05/08 19:03:07
Adding PYTHONNOUSERSITE, which prevents this.
|
| + |
| e.Set("VIRTUAL_ENV", ve.Root) // Set by VirtualEnv script. |
| if ve.EnvironmentStampPath != "" { |
| e.Set(EnvironmentStampPathENV, ve.EnvironmentStampPath) |