diff options
-rw-r--r-- | sos/plugins/__init__.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py index ed55ea38..7ed75a5c 100644 --- a/sos/plugins/__init__.py +++ b/sos/plugins/__init__.py @@ -203,6 +203,11 @@ class SoSPredicate(object): return ((self._eval_kmods() and self._eval_services() and self._eval_packages()) and not self.dry_run) + def __bool__(self): + # Py3 evaluation ends in a __bool__() call where py2 ends in a call + # to __nonzero__(). Wrap the latter here, to support both versions + return self.__nonzero__() + def __init__(self, owner, dry_run=False, kmods=[], services=[], packages=[], required={}): """Initialise a new SoSPredicate object. |