diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-10-05 16:18:38 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-10-05 16:18:38 -0400 |
commit | afd10b31e8c3064301e008299aeaff6d5b2fdcdf (patch) | |
tree | 86dd3142e0ccd7ef7a3c451237d5cd820c2bfe21 | |
parent | c480f3a2e940757a6698f9270db503ebf4111fd7 (diff) | |
download | cmd2-git-afd10b31e8c3064301e008299aeaff6d5b2fdcdf.tar.gz |
Simplified code
-rw-r--r-- | cmd2/pyscript_bridge.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd2/pyscript_bridge.py b/cmd2/pyscript_bridge.py index dcfd9116..7c09aab0 100644 --- a/cmd2/pyscript_bridge.py +++ b/cmd2/pyscript_bridge.py @@ -38,7 +38,7 @@ class CommandResult(namedtuple_with_defaults('CommandResult', ['stdout', 'stderr # 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)): - return True if self.data else False + return bool(self.data) # Otherwise check if stderr was filled out else: |