[S] Change in pysim[master]: osmo-smdpp.py: Resolve possible variable use before assignment

2024-05-23 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/pysim/+/36902?usp=email )

Change subject: osmo-smdpp.py: Resolve possible variable use before assignment
..

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
---
M osmo-smdpp.py
1 file changed, 16 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved




diff --git a/osmo-smdpp.py b/osmo-smdpp.py
index 1f4311d..3dc6131 100755
--- a/osmo-smdpp.py
+++ b/osmo-smdpp.py
@@ -368,6 +368,9 @@
 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

--
To view, visit https://gerrit.osmocom.org/c/pysim/+/36902?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I01b308226e12f91699b1b5c6bb06f853be47e185
Gerrit-Change-Number: 36902
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


[S] Change in pysim[master]: osmo-smdpp.py: Resolve possible variable use before assignment

2024-05-23 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/pysim/+/36902?usp=email )

Change subject: osmo-smdpp.py: Resolve possible variable use before assignment
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/pysim/+/36902?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I01b308226e12f91699b1b5c6bb06f853be47e185
Gerrit-Change-Number: 36902
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Thu, 23 May 2024 14:48:31 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in pysim[master]: osmo-smdpp.py: Resolve possible variable use before assignment

2024-05-22 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/pysim/+/36902?usp=email )


Change subject: osmo-smdpp.py: Resolve possible variable use before assignment
..

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
---
M osmo-smdpp.py
1 file changed, 16 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/02/36902/1

diff --git a/osmo-smdpp.py b/osmo-smdpp.py
index 1f4311d..3dc6131 100755
--- a/osmo-smdpp.py
+++ b/osmo-smdpp.py
@@ -368,6 +368,9 @@
 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

--
To view, visit https://gerrit.osmocom.org/c/pysim/+/36902?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I01b308226e12f91699b1b5c6bb06f853be47e185
Gerrit-Change-Number: 36902
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-MessageType: newchange