Change in pysim[master]: pySim-shell: Use iteration when unregistering command sets

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Sun Oct 24 08:28:30 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/25871 )

Change subject: pySim-shell: Use iteration when unregistering command sets
......................................................................

pySim-shell: Use iteration when unregistering command sets

This makes it more easy to extend in the future

Change-Id: I53ecf03d330fe1eb80ee920e6f9c8185f9be48fd
---
M pySim-shell.py
1 file changed, 4 insertions(+), 6 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



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 @@
 		# 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

-- 
To view, visit https://gerrit.osmocom.org/c/pysim/+/25871
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I53ecf03d330fe1eb80ee920e6f9c8185f9be48fd
Gerrit-Change-Number: 25871
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211024/61545b5e/attachment.htm>


More information about the gerrit-log mailing list