Bug 1585751 - [lint.wpt] Work around mozprocess Windows + Python 3 bug, r=jgraham

Depends on D47975

Differential Revision: https://phabricator.services.mozilla.com/D47976

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andrew Halberstadt 2019-10-03 13:17:34 +00:00
Родитель 522d192cd4
Коммит cf49e5a898
1 изменённых файлов: 9 добавлений и 0 удалений

Просмотреть файл

@ -39,6 +39,15 @@ def lint(files, config, **kwargs):
proc = ProcessHandler(cmd, env=os.environ, processOutputLine=process_line,
universal_newlines=True)
if sys.platform == 'win32':
# Workaround for bug 1585702. According to the win32 docs,
# CreateProcess will use the calling process's env by default. Since we
# are passing in `os.environ` wholesale anyway, setting the env to
# `None` shouldn't make a difference. An alternative workaround would
# be to stop using mozprocess here and use subprocess directly.
proc.env = None
proc.run()
try:
proc.wait()