build: Add a `__bool__` dunder to ConfigurationData

Which will be used by the `configure_file` method of the interpreter.
pull/10044/head
Dylan Baker 3 years ago committed by Eli Schwartz
parent b7dec69b98
commit b4a512b9f8
  1. 3
      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)

Loading…
Cancel
Save