aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2020-11-02 12:15:54 -0500
committerNirbheek Chauhan <nirbheek@centricular.com>2021-01-06 14:51:11 +0530
commitab4373855fd25253ef1a6195ed7c1ee8342e567c (patch)
tree9398d31bb844da80913ff5d10164b6ec8e7c70fe
parentdff9f7097f1604cfbba3bfa70963edb595f70f03 (diff)
downloadmeson-ab4373855fd25253ef1a6195ed7c1ee8342e567c.zip
meson-ab4373855fd25253ef1a6195ed7c1ee8342e567c.tar.gz
meson-ab4373855fd25253ef1a6195ed7c1ee8342e567c.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.py12
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