Skip to content

Commit

Permalink
[wpt] Discard stderr when calling git
Browse files Browse the repository at this point in the history
git occasionally prints warning messages to stderr (e.g. when too many
files are modified and rename detection is disabled), which would mess
with the output parsing if they are redirected to stdout.

Fixes #18608.
  • Loading branch information
Hexcles committed Sep 5, 2019
1 parent ea47721 commit be0223e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/wpt/testfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def git(cmd, *args):
full_cmd = [u"git", cmd] + list(item.decode("utf8") if isinstance(item, bytes) else item for item in args) # type: List[Text]
try:
logger.debug(" ".join(full_cmd))
return subprocess.check_output(full_cmd, cwd=repo_path, stderr=subprocess.STDOUT).decode("utf8").strip()
return subprocess.check_output(full_cmd, cwd=repo_path, stderr=None).decode("utf8").strip()
except subprocess.CalledProcessError as e:
logger.error("Git command exited with status %i" % e.returncode)
logger.error(e.output)
Expand Down

0 comments on commit be0223e

Please sign in to comment.