From b4a512b9f8cecf11e54ffefbb0ee014a34cc00d2 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Mon, 28 Feb 2022 11:36:34 -0800 Subject: build: Add a `__bool__` dunder to ConfigurationData Which will be used by the `configure_file` method of the interpreter. --- mesonbuild/build.py | 3 +++ 1 file changed, 3 insertions(+) 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) -- cgit v1.1