diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2020-11-02 12:15:54 -0500 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2020-11-03 21:28:32 +0200 |
commit | 42cc9294e9ae8641ae94749b1348fe65fde45aa8 (patch) | |
tree | d8027b949667a2aa55759eca6bc728aaad6527e7 | |
parent | 388fa6e7761712a7b1d3422a879fa9e90b6fa606 (diff) | |
download | meson-42cc9294e9ae8641ae94749b1348fe65fde45aa8.zip meson-42cc9294e9ae8641ae94749b1348fe65fde45aa8.tar.gz meson-42cc9294e9ae8641ae94749b1348fe65fde45aa8.tar.bz2 |
wrap: Fix git exception not catched by interpreter
This is a regression introduced in Meson 0.56.0, it was fatal
error when optional dependencies fails to download their fallback
subproject.
-rw-r--r-- | mesonbuild/wrap/wrap.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/mesonbuild/wrap/wrap.py b/mesonbuild/wrap/wrap.py index bc35893..7b50bc1 100644 --- a/mesonbuild/wrap/wrap.py +++ b/mesonbuild/wrap/wrap.py @@ -31,7 +31,8 @@ import textwrap from .._pathlib import Path from . import WrapMode from .. import coredata -from ..mesonlib import verbose_git, quiet_git, GIT, ProgressBar, MesonException +from ..mesonlib import quiet_git, GIT, ProgressBar, MesonException +from .. import mesonlib if T.TYPE_CHECKING: import http.client @@ -186,6 +187,15 @@ def get_directory(subdir_root: str, packagename: str) -> str: return wrap.directory return packagename +def verbose_git(*args, **kwargs): + ''' + Wrapper to convert GitException to WrapException caught in interpreter. + ''' + try: + return mesonlib.verbose_git(*args, **kwargs) + except mesonlib.GitException as e: + raise WrapException(str(e)) + class Resolver: def __init__(self, source_dir: str, subdir: str, wrap_mode: WrapMode = WrapMode.default) -> None: self.source_dir = source_dir |