diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2021-11-02 21:03:32 -0400 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2021-11-02 19:56:10 -0700 |
commit | 1104b82137da55ecb4f13348bbb020d64e4fc78b (patch) | |
tree | 29fd9b7fddbd52d6639e5a543f4d245d27c4121f | |
parent | d23ae8b58e73665d6418137446b259a2666af345 (diff) | |
download | meson-1104b82137da55ecb4f13348bbb020d64e4fc78b.zip meson-1104b82137da55ecb4f13348bbb020d64e4fc78b.tar.gz meson-1104b82137da55ecb4f13348bbb020d64e4fc78b.tar.bz2 |
fix custom_target with install: true and no install_dir, crashing
It's supposed to emit an error message, but instead it did a traceback.
It used to be, if no install_dir was specified then it was simply not in
kwargs, but due to typed_kwargs it will now be there, but not have
viable contents, so the dict membership check got skipped.
Fixes #9522
-rw-r--r-- | mesonbuild/build.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index 6200235..0d606e6 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -2457,7 +2457,7 @@ class CustomTarget(Target, CommandBase): if not isinstance(self.install, bool): raise InvalidArguments('"install" must be boolean.') if self.install: - if 'install_dir' not in kwargs: + if not kwargs.get('install_dir', False): raise InvalidArguments('"install_dir" must be specified ' 'when installing a target') |