Skip to content

Commit 13bac58

Browse files
kmvanbruntanselor
authored andcommitted
Fixed issue where we attempted to remove CommandSet from a list it was not in
1 parent 3741533 commit 13bac58

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cmd2/cmd2.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,8 @@ def install_command_set(self, cmdset: CommandSet) -> None:
458458
except Exception:
459459
for attrib in installed_attributes:
460460
delattr(self, attrib)
461-
self._installed_command_sets.remove(cmdset)
461+
if cmdset in self._installed_command_sets:
462+
self._installed_command_sets.remove(cmdset)
462463
raise
463464

464465
def _install_command_function(self, command: str, command_wrapper: Callable, context=''):

0 commit comments

Comments
 (0)