summaryrefslogtreecommitdiff
path: root/cmd2/py_bridge.py
diff options
context:
space:
mode:
Diffstat (limited to 'cmd2/py_bridge.py')
-rw-r--r--cmd2/py_bridge.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd2/py_bridge.py b/cmd2/py_bridge.py
index 6fd00e07..ab7b4001 100644
--- a/cmd2/py_bridge.py
+++ b/cmd2/py_bridge.py
@@ -73,8 +73,8 @@ class CommandResult(NamedTuple):
def __bool__(self) -> bool:
"""Returns True if the command succeeded, otherwise False"""
- # If data has a __bool__ method, then call it to determine success of command
- if self.data is not None and callable(getattr(self.data, '__bool__', None)):
+ # If data was set, then use it to determine success
+ if self.data is not None:
return bool(self.data)
# Otherwise check if stderr was filled out