aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2022-02-28 11:36:34 -0800
committerEli Schwartz <eschwartz93@gmail.com>2022-03-01 15:17:59 -0500
commitb4a512b9f8cecf11e54ffefbb0ee014a34cc00d2 (patch)
tree0ee600b21d9f927f6ea1a6542a2ee586b1a9fbc4
parentb7dec69b98675985dab9c344dfe7a2bafc89c58a (diff)
downloadmeson-b4a512b9f8cecf11e54ffefbb0ee014a34cc00d2.zip
meson-b4a512b9f8cecf11e54ffefbb0ee014a34cc00d2.tar.gz
meson-b4a512b9f8cecf11e54ffefbb0ee014a34cc00d2.tar.bz2
build: Add a `__bool__` dunder to ConfigurationData
Which will be used by the `configure_file` method of the interpreter.
-rw-r--r--mesonbuild/build.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 6bb487b..47e4a1d 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)