mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 16:25:38 +00:00
Bug 1493510 [wpt PR 13177] - Check if platform is Windows before catching WindowsError, a=testonly
Automatic update from web-platform-testsCheck if platform is Windows before catching WindowsError Check if the platform is Windows and the error is a WindowsError before trying to run git.bat, as WindowsError is not defined in non-Windows. Closes https://github.com/web-platform-tests/wpt/issues/12693 -- wpt-commits: 82d852bda1e08948858389c17402fa0571bc2584 wpt-pr: 13177
This commit is contained in:
parent
51766e943f
commit
7da39973f5
@ -1,5 +1,6 @@
|
||||
import os
|
||||
import subprocess
|
||||
import platform
|
||||
|
||||
from .sourcefile import SourceFile
|
||||
|
||||
@ -16,9 +17,12 @@ class Git(object):
|
||||
full_cmd = ["git", cmd] + list(args)
|
||||
try:
|
||||
return subprocess.check_output(full_cmd, cwd=repo_path, stderr=subprocess.STDOUT)
|
||||
except WindowsError:
|
||||
full_cmd[0] = "git.bat"
|
||||
return subprocess.check_output(full_cmd, cwd=repo_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=repo_path, stderr=subprocess.STDOUT)
|
||||
else:
|
||||
raise
|
||||
return git
|
||||
|
||||
@classmethod
|
||||
|
Loading…
Reference in New Issue
Block a user