summaryrefslogtreecommitdiff
path: root/cmd2
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2020-07-30 12:49:46 -0400
committeranselor <anselor@gmail.com>2020-08-04 13:38:08 -0400
commit13bac58aaf823fda85d9eb60bbb47b3f920792c7 (patch)
tree543eced43d4c9e933a63692ace020940d6add3e8 /cmd2
parent374153366c36bb48dd6caf48995b9f0372ca0d91 (diff)
downloadcmd2-git-13bac58aaf823fda85d9eb60bbb47b3f920792c7.tar.gz
Fixed issue where we attempted to remove CommandSet from a list it was not in
Diffstat (limited to 'cmd2')
-rw-r--r--cmd2/cmd2.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py
index c933db99..3f1696cf 100644
--- a/cmd2/cmd2.py
+++ b/cmd2/cmd2.py
@@ -458,7 +458,8 @@ class Cmd(cmd.Cmd):
except Exception:
for attrib in installed_attributes:
delattr(self, attrib)
- self._installed_command_sets.remove(cmdset)
+ if cmdset in self._installed_command_sets:
+ self._installed_command_sets.remove(cmdset)
raise
def _install_command_function(self, command: str, command_wrapper: Callable, context=''):