mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
repo: Update from upstream
- dc8185f2a9af53fd91fef160313564ad1abf827f launcher: change RunError to subprocess.CalledProcessError by Mike Frysinger <vapier@google.com> GitOrigin-RevId: dc8185f2a9af53fd91fef160313564ad1abf827f Change-Id: Iaa8211ab5363622629372996ff5c487c5d5b0fc7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6422195 Auto-Submit: Copybara Service <copybara-worker-blackhole@google.com> Reviewed-by: Gavin Mak <gavinmak@google.com> Commit-Queue: Gavin Mak <gavinmak@google.com>
This commit is contained in:
committed by
LUCI CQ
parent
c6684fda98
commit
41b8b54089
@@ -482,11 +482,6 @@ def InitParser(parser):
|
||||
return parser
|
||||
|
||||
|
||||
# This is a poor replacement for subprocess.run until we require Python 3.6+.
|
||||
class RunError(Exception):
|
||||
"""Error when running a command failed."""
|
||||
|
||||
|
||||
def run_command(cmd, **kwargs):
|
||||
"""Run |cmd| and return its output."""
|
||||
check = kwargs.pop("check", False)
|
||||
@@ -544,7 +539,8 @@ def run_command(cmd, **kwargs):
|
||||
|
||||
_print_output("stdout", ret.stdout)
|
||||
_print_output("stderr", ret.stderr)
|
||||
raise RunError(ret)
|
||||
# This will raise subprocess.CalledProcessError for us.
|
||||
ret.check_returncode()
|
||||
|
||||
return ret
|
||||
|
||||
@@ -668,7 +664,7 @@ def run_git(*args, **kwargs):
|
||||
file=sys.stderr,
|
||||
)
|
||||
sys.exit(1)
|
||||
except RunError:
|
||||
except subprocess.CalledProcessError:
|
||||
raise CloneFailure()
|
||||
|
||||
|
||||
@@ -850,7 +846,8 @@ def _GetRepoConfig(name):
|
||||
f"repo: error: git {' '.join(cmd)} failed:\n{ret.stderr}",
|
||||
file=sys.stderr,
|
||||
)
|
||||
raise RunError()
|
||||
# This will raise subprocess.CalledProcessError for us.
|
||||
ret.check_returncode()
|
||||
|
||||
|
||||
def _InitHttp():
|
||||
|
||||
Reference in New Issue
Block a user