diff options
Diffstat (limited to 'mesonbuild/interpreterbase/interpreterbase.py')
-rw-r--r-- | mesonbuild/interpreterbase/interpreterbase.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/mesonbuild/interpreterbase/interpreterbase.py b/mesonbuild/interpreterbase/interpreterbase.py index 5204813..b8a6d1a 100644 --- a/mesonbuild/interpreterbase/interpreterbase.py +++ b/mesonbuild/interpreterbase/interpreterbase.py @@ -675,13 +675,11 @@ The result of this is undefined and will become a hard error in a future Meson r @staticmethod def _get_one_string_posarg(posargs: T.List[TYPE_var], method_name: str) -> str: if len(posargs) > 1: - m = f'{method_name}() must have zero or one arguments' - raise InterpreterException(m) + raise InterpreterException(f'{method_name}() must have zero or one arguments') elif len(posargs) == 1: s = posargs[0] if not isinstance(s, str): - m = f'{method_name}() argument must be a string' - raise InterpreterException(m) + raise InterpreterException(f'{method_name}() argument must be a string') return s return None @@ -820,8 +818,7 @@ The result of this is undefined and will become a hard error in a future Meson r return self.evaluate_statement(fallback) return fallback return obj[index] - m = f'Arrays do not have a method called {method_name!r}.' - raise InterpreterException(m) + raise InterpreterException(f'Arrays do not have a method called {method_name!r}.') @builtinMethodNoKwargs def dict_method_call(self, |