From 83c3c745103a254f45ef8b28c5a3e307795ee752 Mon Sep 17 00:00:00 2001 From: Laurin-Luis Lehning <65224843+e820@users.noreply.github.com> Date: Sun, 7 Mar 2021 21:16:13 +0100 Subject: [PATCH] Use interpreter exceptions instead of MesonException --- mesonbuild/interpreterbase.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mesonbuild/interpreterbase.py b/mesonbuild/interpreterbase.py index 93cd1c6c4..bc0c93213 100644 --- a/mesonbuild/interpreterbase.py +++ b/mesonbuild/interpreterbase.py @@ -936,11 +936,11 @@ The result of this is undefined and will become a hard error in a future Meson r try: val = self.variables[var] if not isinstance(val, (str, int, float, bool)): - raise mesonlib.MesonException(f'Identifier {var} does not name a formattable variable.') + raise InvalidCode(f'Identifier {var} does not name a formattable variable.') return str(val) except KeyError: - raise mesonlib.MesonException(f'Identifier "{var}" does not name a variable.') + raise InvalidCode(f'Identifier "{var}" does not name a variable.') return re.sub(r'@([_a-zA-Z][_0-9a-zA-Z]*)@', replace, node.value)