diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2021-06-14 15:36:16 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2021-06-22 09:12:54 -0700 |
commit | 3d940fec980f61c8b5a6cb74a6af61c59c307db9 (patch) | |
tree | e70c6720192d58dff727d10b06b051ecfefa8e75 /mesonbuild/interpreter/interpreter.py | |
parent | dd296f321ba102052dcf3d0a67e4321752d560a2 (diff) | |
download | meson-3d940fec980f61c8b5a6cb74a6af61c59c307db9.zip meson-3d940fec980f61c8b5a6cb74a6af61c59c307db9.tar.gz meson-3d940fec980f61c8b5a6cb74a6af61c59c307db9.tar.bz2 |
interpreter: use typed_pos_args for install_subdir
Diffstat (limited to 'mesonbuild/interpreter/interpreter.py')
-rw-r--r-- | mesonbuild/interpreter/interpreter.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index 75f55fd..82bb71d 100644 --- a/mesonbuild/interpreter/interpreter.py +++ b/mesonbuild/interpreter/interpreter.py @@ -1965,13 +1965,9 @@ This will become a hard error in the future.''' % kwargs['input'], location=self @FeatureNewKwargs('install_subdir', '0.42.0', ['exclude_files', 'exclude_directories']) @FeatureNewKwargs('install_subdir', '0.38.0', ['install_mode']) @permittedKwargs({'exclude_files', 'exclude_directories', 'install_dir', 'install_mode', 'strip_directory'}) - @stringArgs - def func_install_subdir(self, node, args, kwargs): - if len(args) != 1: - raise InvalidArguments('Install_subdir requires exactly one argument.') - subdir: str = args[0] - if not isinstance(subdir, str): - raise InvalidArguments('install_subdir positional argument 1 must be a string.') + @typed_pos_args('install_subdir', str) + def func_install_subdir(self, node: mparser.BaseNode, args: T.Tuple[str], kwargs): + subdir = args[0] if 'install_dir' not in kwargs: raise InvalidArguments('Missing keyword argument install_dir') install_dir: str = kwargs['install_dir'] |