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:13:41 -0700 |
commit | a551e7613728051a398f296cda40a4c8cf25dcbb (patch) | |
tree | c87b1caab920922cfa7d2521aa0f2620f99306f7 | |
parent | 596c8d4af50d0e5a25ee0ee1e177e46b6c7ad22e (diff) | |
download | meson-a551e7613728051a398f296cda40a4c8cf25dcbb.zip meson-a551e7613728051a398f296cda40a4c8cf25dcbb.tar.gz meson-a551e7613728051a398f296cda40a4c8cf25dcbb.tar.bz2 |
interpreter: use typed_pos_args for install_data
-rw-r--r-- | mesonbuild/interpreter/interpreter.py | 6 | ||||
-rw-r--r-- | test cases/failing/95 custom target install data/test.json | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index 2875726..d5bfdb9 100644 --- a/mesonbuild/interpreter/interpreter.py +++ b/mesonbuild/interpreter/interpreter.py @@ -1999,9 +1999,11 @@ This will become a hard error in the future.''' % kwargs['input'], location=self @FeatureNewKwargs('install_data', '0.46.0', ['rename']) @FeatureNewKwargs('install_data', '0.38.0', ['install_mode']) @permittedKwargs({'install_dir', 'install_mode', 'rename', 'sources'}) - def func_install_data(self, node, args: T.List, kwargs: T.Dict[str, T.Any]): + @typed_pos_args('install_data', varargs=(str, mesonlib.File)) + def func_install_data(self, node: mparser.BaseNode, args: T.Tuple[T.List['mesonlib.FileOrString']], + kwargs: T.Dict[str, T.Any]): kwsource = mesonlib.stringlistify(kwargs.get('sources', [])) - raw_sources = args + kwsource + raw_sources = args[0] + kwsource sources: T.List[mesonlib.File] = [] source_strings: T.List[str] = [] for s in raw_sources: diff --git a/test cases/failing/95 custom target install data/test.json b/test cases/failing/95 custom target install data/test.json index 64ef530..c8004d6 100644 --- a/test cases/failing/95 custom target install data/test.json +++ b/test cases/failing/95 custom target install data/test.json @@ -1,7 +1,7 @@ { "stdout": [ { - "line": "test cases/failing/95 custom target install data/meson.build:11:0: ERROR: Argument must be string or file." + "line": "test cases/failing/95 custom target install data/meson.build:11:0: ERROR: install_data argument 1 was of type \"CustomTarget\" but should have been one of: \"str\", \"File\"" } ] } |