From 677d41bb41f5862b535ce590d649ac26ddb00b93 Mon Sep 17 00:00:00 2001 From: Daniel Willmann Date: Mon, 19 Oct 2020 10:34:31 +0200 Subject: Remove unnecessary semicolon Change-Id: I9c5665cd2a45a0d06444349eaaeeb5b83a09ffc1 --- pySim-prog.py | 12 ++++++------ pySim/cards.py | 4 ++-- pySim/commands.py | 2 +- pySim/transport/pcsc.py | 2 +- pySim/transport/serial.py | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/pySim-prog.py b/pySim-prog.py index 0f752fb..f2d3676 100755 --- a/pySim-prog.py +++ b/pySim-prog.py @@ -260,7 +260,7 @@ def _dbi_binary_quote(s): m = sum_ e = i if m == 0: # No overhead ? use this ! - break; + break # Generate output out = [] @@ -303,7 +303,7 @@ def gen_parameters(opts): if opts.name is not None: if len(opts.name) > 16: - raise ValueError('Service Provider Name must max 16 characters!'); + raise ValueError('Service Provider Name must max 16 characters!') if opts.msisdn is not None: msisdn = opts.msisdn @@ -320,7 +320,7 @@ def gen_parameters(opts): if opts.iccid is not None: iccid = opts.iccid if not _isnum(iccid, 19) and not _isnum(iccid, 20): - raise ValueError('ICCID must be 19 or 20 digits !'); + raise ValueError('ICCID must be 19 or 20 digits !') else: if opts.num is None: @@ -492,15 +492,15 @@ def _read_params_csv(opts, iccid=None, imsi=None): if opts.num is not None and opts.read_iccid is False and opts.read_imsi is False: if opts.num == i: f.close() - return row; + return row i += 1 if row['iccid'] == iccid: f.close() - return row; + return row if row['imsi'] == imsi: f.close() - return row; + return row f.close() return None diff --git a/pySim/cards.py b/pySim/cards.py index a67540f..e949fff 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -329,7 +329,7 @@ class _MagicSimBase(Card): r = self._scc.select_file(['3f00', '7f4d', f[0]]) rec_len = int(r[-1][28:30], 16) tlen = int(r[-1][4:8],16) - rec_cnt = (tlen / rec_len) - 1; + rec_cnt = (tlen / rec_len) - 1 if (rec_cnt < 1) or (rec_len != f[1]): raise RuntimeError('Bad card type') @@ -459,7 +459,7 @@ class FakeMagicSim(Card): r = self._scc.select_file(['3f00', '000c']) rec_len = int(r[-1][28:30], 16) tlen = int(r[-1][4:8],16) - rec_cnt = (tlen / rec_len) - 1; + rec_cnt = (tlen / rec_len) - 1 if (rec_cnt < 1) or (rec_len != 0x5a): raise RuntimeError('Bad card type') diff --git a/pySim/commands.py b/pySim/commands.py index c260a97..7b8ebec 100644 --- a/pySim/commands.py +++ b/pySim/commands.py @@ -26,7 +26,7 @@ from pySim.utils import rpad, b2h class SimCardCommands(object): def __init__(self, transport): - self._tp = transport; + self._tp = transport self._cla_byte = "a0" self.sel_ctrl = "0000" diff --git a/pySim/transport/pcsc.py b/pySim/transport/pcsc.py index 380c8fd..4775a1b 100644 --- a/pySim/transport/pcsc.py +++ b/pySim/transport/pcsc.py @@ -35,7 +35,7 @@ from pySim.utils import h2i, i2h class PcscSimLink(LinkBase): def __init__(self, reader_number=0): - r = readers(); + r = readers() self._reader = r[reader_number] self._con = self._reader.createConnection() diff --git a/pySim/transport/serial.py b/pySim/transport/serial.py index 11fcd6a..61195e0 100644 --- a/pySim/transport/serial.py +++ b/pySim/transport/serial.py @@ -117,7 +117,7 @@ class SerialSimLink(LinkBase): rst_meth = rst_meth_map[self._rst_pin[1:]] rst_val = rst_val_map[self._rst_pin[0]] except: - raise ValueError('Invalid reset pin %s' % self._rst_pin); + raise ValueError('Invalid reset pin %s' % self._rst_pin) rst_meth(rst_val) time.sleep(0.1) # 100 ms @@ -128,7 +128,7 @@ class SerialSimLink(LinkBase): if not b: return 0 if ord(b) != 0x3b: - return -1; + return -1 self._dbg_print("TS: 0x%x Direct convention" % ord(b)) while ord(b) == 0x3b: @@ -222,7 +222,7 @@ class SerialSimLink(LinkBase): if (to_recv == 2) and (b == '\x60'): # Ignore NIL if we have no RX data (hack ?) continue if not b: - break; + break data += b # Split datafield from SW -- cgit v1.2.3