diff options
author | Harald Welte <laforge@osmocom.org> | 2021-10-20 14:24:41 +0200 |
---|---|---|
committer | Harald Welte <laforge@osmocom.org> | 2021-10-21 14:12:13 +0200 |
commit | 0bc5326b767eef5fd308c99f44aee0b04d6e87cb (patch) | |
tree | 28f28c25b4b69a5adcb3645631918c0bbcb87e51 /pySim-shell.py | |
parent | ec95053249bc7f9308ca1f659d8ef6ac97a6e393 (diff) |
pySim-shell: Use iteration when unregistering command sets
This makes it more easy to extend in the future
Change-Id: I53ecf03d330fe1eb80ee920e6f9c8185f9be48fd
Diffstat (limited to 'pySim-shell.py')
-rwxr-xr-x | pySim-shell.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/pySim-shell.py b/pySim-shell.py index ff12396..1fc09ef 100755 --- a/pySim-shell.py +++ b/pySim-shell.py @@ -138,12 +138,10 @@ class PysimApp(cmd2.Cmd): # Unequip everything from pySim-shell that would not work in unequipped state if self.rs: self.rs.unregister_cmds(self) - cmd_set = self.find_commandsets(Iso7816Commands) - if cmd_set: - self.unregister_command_set(cmd_set[0]) - cmd_set = self.find_commandsets(PySimCommands) - if cmd_set: - self.unregister_command_set(cmd_set[0]) + for cmds in [Iso7816Commands, PySimCommands]: + cmd_set = self.find_commandsets(cmds) + if cmd_set: + self.unregister_command_set(cmd_set[0]) self.card = card self.rs = rs |