Chromium Code Reviews| Index: Tools/Scripts/webkitpy/common/system/executive.py |
| diff --git a/Tools/Scripts/webkitpy/common/system/executive.py b/Tools/Scripts/webkitpy/common/system/executive.py |
| index 5d53ab9b57c7e849a5d100ec5cd8be2064d0061b..bde0051689f6144d7ebbfbade376b9ecfadd8607 100644 |
| --- a/Tools/Scripts/webkitpy/common/system/executive.py |
| +++ b/Tools/Scripts/webkitpy/common/system/executive.py |
| @@ -43,6 +43,22 @@ from webkitpy.common.system.filesystem import FileSystem |
| _log = logging.getLogger(__name__) |
| +class EnvPath(list): |
| + """EnvPath represents a system environment PATH. It can be used for all |
| + environment variables which are PATH-like, such as PYTHONPATH. The paths |
| + are represented as a simple python list and live in memory until update() |
| + is called at which point the environment variable gets written to. |
| + """ |
| + |
| + def __init__(self, env, var, pathsep): |
| + self._env = env |
| + self._pathsep = pathsep |
| + self._var = var |
| + super(EnvPath, self).__init__(self._env[self._var].split(self._pathsep)) |
| + |
| + def update(self): |
| + self._env[self._var] = self._pathsep.join(self) |
|
Dirk Pranke
2015/06/12 22:25:01
These changes are not necessary, and we should nev
burnik
2015/06/15 10:35:09
Done.
|
| + |
| class ScriptError(Exception): |
| @@ -86,6 +102,8 @@ class ScriptError(Exception): |
| class Executive(object): |
| PIPE = subprocess.PIPE |
| STDOUT = subprocess.STDOUT |
| + DEVNULL = open(os.devnull, 'wb') |
| + pythonpath = EnvPath(os.environ, "PYTHONPATH", os.pathsep) |
|
Dirk Pranke
2015/06/12 22:25:01
the pythonpath change isn't necessary.
burnik
2015/06/15 10:35:09
Done.
|
| def _should_close_fds(self): |
| # We need to pass close_fds=True to work around Python bug #2320 |