Update web-platform-tests to revision fd0429f0b45f975b25d85256dac33762134952c5

This commit is contained in:
WPT Sync Bot 2019-04-15 21:58:05 -04:00
parent 0ba7da4431
commit c8202ddbe1
50 changed files with 1210 additions and 191 deletions

View file

@ -1,5 +1,6 @@
import platform
import os
import platform
import subprocess
from six import BytesIO
@ -32,6 +33,27 @@ def to_os_path(path):
return path.replace("/", os.path.sep)
def git(path):
def gitfunc(cmd, *args):
full_cmd = ["git", cmd] + list(args)
try:
return subprocess.check_output(full_cmd, cwd=path, stderr=subprocess.STDOUT)
except Exception as e:
if platform.uname()[0] == "Windows" and isinstance(e, WindowsError):
full_cmd[0] = "git.bat"
return subprocess.check_output(full_cmd, cwd=path, stderr=subprocess.STDOUT)
else:
raise
try:
# this needs to be a command that fails if we aren't in a git repo
gitfunc("rev-parse", "--show-toplevel")
except (subprocess.CalledProcessError, OSError):
return None
else:
return gitfunc
class ContextManagerBytesIO(BytesIO):
def __enter__(self):
return self