diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2021-07-12 15:27:29 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2021-07-13 16:43:14 -0700 |
commit | a881e849b5789c7d47d36c09fcd4cc7bdd2ee3c9 (patch) | |
tree | 3930fe7cce117e153a4be65a88c428b71b562e1a /mesonbuild/interpreter/interpreter.py | |
parent | 9eec2a131bee59e1cd7a54f395aadc4eb26ad01d (diff) | |
download | meson-a881e849b5789c7d47d36c09fcd4cc7bdd2ee3c9.zip meson-a881e849b5789c7d47d36c09fcd4cc7bdd2ee3c9.tar.gz meson-a881e849b5789c7d47d36c09fcd4cc7bdd2ee3c9.tar.bz2 |
modules/python: simplify a number of interfaces
Including not calling back into `Interpreter.func_*`, which is not a
good idea both from a type saftey and perforamance point of view.
Instead there's now a shared _impl method
Diffstat (limited to 'mesonbuild/interpreter/interpreter.py')
-rw-r--r-- | mesonbuild/interpreter/interpreter.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index daef5fd..518ba10 100644 --- a/mesonbuild/interpreter/interpreter.py +++ b/mesonbuild/interpreter/interpreter.py @@ -2032,9 +2032,12 @@ This will become a hard error in the future.''' % kwargs['input'], location=self '"rename" and "sources" argument lists must be the same length if "rename" is given. ' f'Rename has {len(rename)} elements and sources has {len(sources)}.') - data = build.Data( - sources, kwargs['install_dir'], kwargs['install_mode'], - self.subproject, rename) + return self.install_data_impl(sources, kwargs['install_dir'], kwargs['install_mode'], rename) + + def install_data_impl(self, sources: T.List[mesonlib.File], install_dir: str, + install_mode: FileMode, rename: T.Optional[str]) -> build.Data: + """Just the implementation with no validation.""" + data = build.Data(sources, install_dir, install_mode, self.subproject, rename) self.build.data.append(data) return data |