Change in pysim[master]: filesystem: Fix interpret_sw() fall-through

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Fri Apr 2 21:08:38 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/23586 )

Change subject: filesystem: Fix interpret_sw() fall-through
......................................................................

filesystem: Fix interpret_sw() fall-through

if an application-specific interpret_sw() fails, fall back to the
profile interpret_sw().

Change-Id: I326c6002c75e2f906848784b7831ea169134dbe4
---
M pySim/filesystem.py
1 file changed, 3 insertions(+), 5 deletions(-)

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



diff --git a/pySim/filesystem.py b/pySim/filesystem.py
index 9a68d5a..55a7130 100644
--- a/pySim/filesystem.py
+++ b/pySim/filesystem.py
@@ -875,6 +875,7 @@
         Returns:
             Tuple of two strings
         """
+        res = None
         adf = self.get_application_df()
         if adf:
             app = adf.application
@@ -882,11 +883,8 @@
             # method or we will use the interpret_sw method from the
             # card profile.
             if app and hasattr(app, "interpret_sw"):
-                return app.interpret_sw(sw)
-            else:
-                return self.profile.interpret_sw(sw)
-        else:
-            return self.profile.interpret_sw(sw)
+                res = app.interpret_sw(sw)
+        return res or self.profile.interpret_sw(sw)
 
     def probe_file(self, fid:str, cmd_app=None):
         """Blindly try to select a file and automatically add a matching file

-- 
To view, visit https://gerrit.osmocom.org/c/pysim/+/23586
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I326c6002c75e2f906848784b7831ea169134dbe4
Gerrit-Change-Number: 23586
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210402/a9f2d603/attachment.htm>


More information about the gerrit-log mailing list