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
This commit is contained in:
Harald Welte
2024-05-17 11:12:49 +02:00
parent 45b7d0126b
commit bb2cba83c5

View File

@@ -606,6 +606,8 @@ class SimCardCommands:
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: