Change in pysim[master]: Python is not C: get rid of unnecessary semicolons

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/.

fixeria gerrit-no-reply at lists.osmocom.org
Fri Nov 5 16:04:03 UTC 2021


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

Change subject: Python is not C: get rid of unnecessary semicolons
......................................................................

Python is not C: get rid of unnecessary semicolons

See https://www.python.org/dev/peps/pep-0008/.

Change-Id: I9de3bcd324b0a1b98af761678996eaae85f7f790
Related: OS#5292
---
M pySim-shell.py
M pySim/utils.py
2 files changed, 7 insertions(+), 7 deletions(-)

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



diff --git a/pySim-shell.py b/pySim-shell.py
index 3fc5859..0be6f21 100755
--- a/pySim-shell.py
+++ b/pySim-shell.py
@@ -72,15 +72,15 @@
 		sl.wait_for_card(3)
 	except NoCardError:
 		print("No card detected!")
-		return None, None;
+		return None, None
 	except:
 		print("Card not readable!")
-		return None, None;
+		return None, None
 
 	card = card_detect("auto", scc)
 	if card is None:
 		print("Could not detect card type!")
-		return None, None;
+		return None, None
 
 	# Create runtime state with card profile
 	profile = CardProfileUICC()
@@ -207,7 +207,7 @@
 	@cmd2.with_category(CUSTOM_CATEGORY)
 	def do_equip(self, opts):
 		"""Equip pySim-shell with card"""
-		rs, card = init_card(sl);
+		rs, card = init_card(sl)
 		self.equip(card, rs)
 
 	class InterceptStderr(list):
@@ -352,7 +352,7 @@
 			except (KeyboardInterrupt):
 				self.poutput("")
 				self.poutput("Terminated by user!")
-				return;
+				return
 			except (SystemExit):
 				# When all cards are processed the card handler device will throw a SystemExit
 				# exception. Also Errors that are not recoverable (cards stuck etc.) will end up here.
diff --git a/pySim/utils.py b/pySim/utils.py
index def88f0..68de14a 100644
--- a/pySim/utils.py
+++ b/pySim/utils.py
@@ -133,7 +133,7 @@
     compr = tag.get('comprehension', False)
     if tag['tag'] in [0x00, 0x80, 0xff] or tag['tag'] > 0xff:
         # 3-byte format
-        byte3 = tag['tag'] & 0xff;
+        byte3 = tag['tag'] & 0xff
         byte2 = (tag['tag'] >> 8) & 0x7f
         if compr:
             byte2 |= 0x80
@@ -243,7 +243,7 @@
         t |= (cls & 3) << 6
         return bytes([t])
     else: # multi-byte tag
-        t = 0x1f;
+        t = 0x1f
         if constructed:
             t |= 0x20
         t |= (cls & 3) << 6

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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I9de3bcd324b0a1b98af761678996eaae85f7f790
Gerrit-Change-Number: 26124
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211105/bf24ebfe/attachment.htm>


More information about the gerrit-log mailing list