diff options
author | Daniel Willmann <daniel@totalueberwachung.de> | 2020-10-19 10:35:11 +0200 |
---|---|---|
committer | Daniel Willmann <daniel@totalueberwachung.de> | 2020-10-19 10:35:11 +0200 |
commit | dd014ea3064e5a349e8b938a7ef272460c53036a (patch) | |
tree | 41e1abb99734a5d0784c5344220580be009344d8 | |
parent | 677d41bb41f5862b535ce590d649ac26ddb00b93 (diff) |
Lint fixes: false -> False, missing imports, Index list, not map iter
Change-Id: Iff4123a49c8dbcfc405612c0663d5c7d0f549748
-rwxr-xr-x | pySim-prog.py | 4 | ||||
-rw-r--r-- | pySim/transport/pcsc.py | 4 | ||||
-rw-r--r-- | pySim/utils.py | 2 |
3 files changed, 5 insertions, 5 deletions
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 @@ def process_card(opts, first, card_handler): 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 @@ def calculate_luhn(cc): """ 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 |