From 81bc26cc31769678d9870d0f3116aa8af9b9b292 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 22 May 2024 18:00:19 +0200 Subject: [PATCH] osmo-smdpp.py: Resolve possible variable use before assignment osmo-smdpp.py:374:72: E0601: Using variable 'iccid_str' before assignment (used-before-assignment) Let's raise an exception in the erroneous case. Change-Id: I01b308226e12f91699b1b5c6bb06f853be47e185 --- osmo-smdpp.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osmo-smdpp.py b/osmo-smdpp.py index 1f4311da..3dc6131a 100755 --- a/osmo-smdpp.py +++ b/osmo-smdpp.py @@ -368,6 +368,9 @@ class SmDppHttpServer: pes = saip.ProfileElementSequence.from_der(f.read()) iccid_str = b2h(pes.get_pe_for_type('header').decoded['iccid']) + # make pylint happy: E0601: Using variable 'iccid_str' before assignment (used-before-assignment) + assert iccid_str + # FIXME: we actually want to perform the profile binding herr, and read the profile metadat from the profile # Put together profileMetadata + _bin