From 1325e59b1af38fe4ee7f8a477cb669a2331c06cf Mon Sep 17 00:00:00 2001 From: Marc Bonnici Date: Wed, 17 Jul 2019 11:46:55 +0100 Subject: [PATCH] target/KernelConfig: Implement the `__bool__` method To aid in checking whether any information is contained in the `KernelConfig` ensure that that `__bool__` method value indicated the presence of parsed input. --- devlib/target.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/devlib/target.py b/devlib/target.py index 87669cd..fb628ae 100644 --- a/devlib/target.py +++ b/devlib/target.py @@ -2020,6 +2020,9 @@ class KernelConfig(object): # Expose the original text for backward compatibility self.text = text + def __bool__(self): + return bool(self.typed_config) + not_set_regex = TypedKernelConfig.not_set_regex def iteritems(self):