laforge submitted this change.
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(-)
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:
To view, visit change 36900. To unsubscribe, or for help writing mail filters, visit settings.