aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2020-07-14 11:57:59 -0400
committerJussi Pakkanen <jpakkane@gmail.com>2020-07-14 20:49:47 +0300
commit2353d67c25629da049b192d7fddb3e7851edb8df (patch)
tree535984640d4a9e954a738891ae4e44576c20ad6f
parent4b728293cd111da3d524a23fb02b457f39e5c406 (diff)
downloadmeson-2353d67c25629da049b192d7fddb3e7851edb8df.zip
meson-2353d67c25629da049b192d7fddb3e7851edb8df.tar.gz
meson-2353d67c25629da049b192d7fddb3e7851edb8df.tar.bz2
wrap: Raise MesonException when git command fails
This avoid printing long backtrace by default, the user already has the output of the git command printed for debugging purpose since we don't redirect stdout/stderr.
-rw-r--r--mesonbuild/wrap/wrap.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/mesonbuild/wrap/wrap.py b/mesonbuild/wrap/wrap.py
index 54daaf3..aba220e 100644
--- a/mesonbuild/wrap/wrap.py
+++ b/mesonbuild/wrap/wrap.py
@@ -61,7 +61,10 @@ def quiet_git(cmd: T.List[str], workingdir: str) -> T.Tuple[bool, str]:
def verbose_git(cmd: T.List[str], workingdir: str, check: bool = False) -> bool:
if not GIT:
return False
- return git(cmd, workingdir, check=check).returncode == 0
+ try:
+ return git(cmd, workingdir, check=check).returncode == 0
+ except subprocess.CalledProcessError:
+ raise WrapException('Git command failed')
def whitelist_wrapdb(urlstr: str) -> urllib.parse.ParseResult:
""" raises WrapException if not whitelisted subdomain """