From 74819dbd2a323d6ab37860a25135d146602eb579 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Wed, 11 Aug 2021 10:18:57 -0700 Subject: [PATCH] interpreter: Allow FileMode to be passed to _get_kwarg_install_mode This will happen as we transition from doing the conversion in the function body to using the KwargInfo to make that change. If we get one just return it. --- mesonbuild/interpreter/interpreter.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index 9fb15d943..78c8f95b7 100644 --- a/mesonbuild/interpreter/interpreter.py +++ b/mesonbuild/interpreter/interpreter.py @@ -1898,6 +1898,8 @@ This will become a hard error in the future.''' % kwargs['input'], location=self def _get_kwarg_install_mode(self, kwargs: T.Dict[str, T.Any]) -> T.Optional[FileMode]: if kwargs.get('install_mode', None) is None: return None + if isinstance(kwargs['install_mode'], FileMode): + return kwargs['install_mode'] install_mode: T.List[str] = [] mode = mesonlib.typeslistify(kwargs.get('install_mode', []), (str, int)) for m in mode: