Skip to content

Commit 42cc929

Browse files
xclaessejpakkane
authored andcommitted
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.
1 parent 388fa6e commit 42cc929

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

mesonbuild/wrap/wrap.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
from .._pathlib import Path
3232
from . import WrapMode
3333
from .. import coredata
34-
from ..mesonlib import verbose_git, quiet_git, GIT, ProgressBar, MesonException
34+
from ..mesonlib import quiet_git, GIT, ProgressBar, MesonException
35+
from .. import mesonlib
3536

3637
if T.TYPE_CHECKING:
3738
import http.client
@@ -186,6 +187,15 @@ def get_directory(subdir_root: str, packagename: str) -> str:
186187
return wrap.directory
187188
return packagename
188189

190+
def verbose_git(*args, **kwargs):
191+
'''
192+
Wrapper to convert GitException to WrapException caught in interpreter.
193+
'''
194+
try:
195+
return mesonlib.verbose_git(*args, **kwargs)
196+
except mesonlib.GitException as e:
197+
raise WrapException(str(e))
198+
189199
class Resolver:
190200
def __init__(self, source_dir: str, subdir: str, wrap_mode: WrapMode = WrapMode.default) -> None:
191201
self.source_dir = source_dir

0 commit comments

Comments
 (0)