diff options
| author | Dylan Baker <dylan@pnwbakers.com> | 2022-02-28 11:36:34 -0800 |
|---|---|---|
| committer | Eli Schwartz <eschwartz93@gmail.com> | 2022-03-01 15:17:59 -0500 |
| commit | b4a512b9f8cecf11e54ffefbb0ee014a34cc00d2 (patch) | |
| tree | 0ee600b21d9f927f6ea1a6542a2ee586b1a9fbc4 /mesonbuild | |
| parent | b7dec69b98675985dab9c344dfe7a2bafc89c58a (diff) | |
| download | meson-b4a512b9f8cecf11e54ffefbb0ee014a34cc00d2.tar.gz | |
build: Add a `__bool__` dunder to ConfigurationData
Which will be used by the `configure_file` method of the interpreter.
Diffstat (limited to 'mesonbuild')
| -rw-r--r-- | mesonbuild/build.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index 6bb487b58..47e4a1d69 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -2719,6 +2719,9 @@ class ConfigurationData(HoldableObject): def __contains__(self, value: str) -> bool: return value in self.values + def __bool__(self) -> bool: + return bool(self.values) + def get(self, name: str) -> T.Tuple[T.Union[str, int, bool], T.Optional[str]]: return self.values[name] # (val, desc) |
