diff --git a/pySim/card_handler.py b/pySim/card_handler.py
index 57e0d32b..e7884ad0 100644
--- a/pySim/card_handler.py
+++ b/pySim/card_handler.py
@@ -24,12 +24,11 @@ there are also automatic card feeders.
# along with this program. If not, see .
#
-from pySim.transport import LinkBase
-
import subprocess
import sys
import yaml
+from pySim.transport import LinkBase
class CardHandlerBase:
"""Abstract base class representing a mechanism for card insertion/removal."""
@@ -97,7 +96,7 @@ class CardHandlerAuto(CardHandlerBase):
print("Card handler Config-file: " + str(config_file))
with open(config_file) as cfg:
self.cmds = yaml.load(cfg, Loader=yaml.FullLoader)
- self.verbose = (self.cmds.get('verbose') == True)
+ self.verbose = self.cmds.get('verbose') is True
def __print_outout(self, out):
print("")
diff --git a/pySim/card_key_provider.py b/pySim/card_key_provider.py
index 00e32aa3..33a2a3de 100644
--- a/pySim/card_key_provider.py
+++ b/pySim/card_key_provider.py
@@ -54,11 +54,11 @@ class CardKeyProvider(abc.ABC):
dictionary of {field, value} strings for each requested field from 'fields'
"""
for f in fields:
- if (f not in self.VALID_FIELD_NAMES):
+ if f not in self.VALID_FIELD_NAMES:
raise ValueError("Requested field name '%s' is not a valid field name, valid field names are: %s" %
(f, str(self.VALID_FIELD_NAMES)))
- if (key not in self.VALID_FIELD_NAMES):
+ if key not in self.VALID_FIELD_NAMES:
raise ValueError("Key field name '%s' is not a valid field name, valid field names are: %s" %
(key, str(self.VALID_FIELD_NAMES)))
diff --git a/pySim/iso7816_4.py b/pySim/iso7816_4.py
index 1da58097..64d814d9 100644
--- a/pySim/iso7816_4.py
+++ b/pySim/iso7816_4.py
@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see .
"""
-from construct import *
+from construct import GreedyBytes, GreedyString
from pySim.construct import *
from pySim.utils import *
from pySim.filesystem import *
diff --git a/pySim/jsonpath.py b/pySim/jsonpath.py
index 4dd838c0..5778de9c 100644
--- a/pySim/jsonpath.py
+++ b/pySim/jsonpath.py
@@ -1,8 +1,3 @@
-# coding=utf-8
-import json
-import pprint
-import jsonpath_ng
-
"""JSONpath utility functions as needed within pysim.
As pySim-sell has the ability to represent SIM files as JSON strings,
@@ -10,6 +5,8 @@ adding JSONpath allows us to conveniently modify individual sub-fields
of a file or record in its JSON representation.
"""
+import jsonpath_ng
+
# (C) 2021 by Harald Welte
#
# This program is free software: you can redistribute it and/or modify