laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/36900?usp=email )
Change subject: commands.py: Resolve possible variable use before assignment ......................................................................
commands.py: Resolve possible variable use before assignment
pySim/commands.py:608:39: E0606: Possibly using variable 'p2' before assignment (possibly-used-before-assignment)
Let's raise an exception in the erroneous case.
Change-Id: I23adf2e89aa8a13246cc20ef022c84f0113eb2cd --- M pySim/commands.py 1 file changed, 15 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/00/36900/1
diff --git a/pySim/commands.py b/pySim/commands.py index 08537bd..7b21faf 100644 --- a/pySim/commands.py +++ b/pySim/commands.py @@ -606,6 +606,8 @@ p2 = '81' elif context == 'gsm': p2 = '80' + else: + raise ValueError("Unsupported context '%s'" % context) (data, sw) = self.send_apdu_constr_checksw( self.cla_byte, '88', '00', p2, AuthCmd3G, cmd_data, AuthResp3G) if 'auts' in data: