Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2296)

Unified Diff: Tools/Scripts/webkitpy/common/system/executive.py

Issue 1154373005: Introduce WPTServe for running W3C Blink Layout tests (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add additional README for maintenance. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698