Change in pysim[master]: Lint fixes: false -> False, missing imports, Index list, not map iter

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

daniel gerrit-no-reply at lists.osmocom.org
Mon Oct 19 09:05:52 UTC 2020


daniel has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/20762 )


Change subject: Lint fixes: false -> False, missing imports, Index list, not map iter
......................................................................

Lint fixes: false -> False, missing imports, Index list, not map iter

Change-Id: Iff4123a49c8dbcfc405612c0663d5c7d0f549748
---
M pySim-prog.py
M pySim/transport/pcsc.py
M pySim/utils.py
3 files changed, 5 insertions(+), 5 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/62/20762/1

diff --git a/pySim-prog.py b/pySim-prog.py
index f2d3676..942cfb0 100755
--- a/pySim-prog.py
+++ b/pySim-prog.py
@@ -647,13 +647,13 @@
 		if opts.read_iccid:
 			if opts.dry_run:
 				# Connect transport
-				card_handler.get(false)
+				card_handler.get(False)
 			(res,_) = scc.read_binary(['3f00', '2fe2'], length=10)
 			iccid = dec_iccid(res)
 		elif opts.read_imsi:
 			if opts.dry_run:
 				# Connect transport
-				card_handler.get(false)
+				card_handler.get(False)
 			(res,_) = scc.read_binary(EF['IMSI'])
 			imsi = swap_nibbles(res)[3:]
 		else:
diff --git a/pySim/transport/pcsc.py b/pySim/transport/pcsc.py
index 4775a1b..7b50869 100644
--- a/pySim/transport/pcsc.py
+++ b/pySim/transport/pcsc.py
@@ -24,10 +24,10 @@
 
 from smartcard.CardConnection import CardConnection
 from smartcard.CardRequest import CardRequest
-from smartcard.Exceptions import NoCardException, CardRequestTimeoutException
+from smartcard.Exceptions import NoCardException, CardRequestTimeoutException, CardConnectionException
 from smartcard.System import readers
 
-from pySim.exceptions import NoCardError
+from pySim.exceptions import NoCardError, ProtocolError
 from pySim.transport import LinkBase
 from pySim.utils import h2i, i2h
 
diff --git a/pySim/utils.py b/pySim/utils.py
index c5cf480..f7d099b 100644
--- a/pySim/utils.py
+++ b/pySim/utils.py
@@ -249,7 +249,7 @@
 	"""
 	Calculate Luhn checksum used in e.g. ICCID and IMEI
 	"""
-	num = map(int, str(cc))
+	num = list(map(int, str(cc)))
 	check_digit = 10 - sum(num[-2::-2] + [sum(divmod(d * 2, 10)) for d in num[::-2]]) % 10
 	return 0 if check_digit == 10 else check_digit
 

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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Iff4123a49c8dbcfc405612c0663d5c7d0f549748
Gerrit-Change-Number: 20762
Gerrit-PatchSet: 1
Gerrit-Owner: daniel <dwillmann at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201019/1efdfcaf/attachment.htm>


More information about the gerrit-log mailing list