laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/40759?usp=email )
Change subject: pySim.esim.saip.FsNodeADF: Fix __str__ method ......................................................................
pySim.esim.saip.FsNodeADF: Fix __str__ method
It's quite common for a FsNodeADF to not have a df_name, so we need to guard against that during stringification to avoid an exception.
Change-Id: I919d7c46575e0ebcdf3b979347a5cdd1a9feb294 --- M pySim/esim/saip/__init__.py 1 file changed, 2 insertions(+), 1 deletion(-)
Approvals: fixeria: Looks good to me, but someone else must approve Jenkins Builder: Verified laforge: Looks good to me, approved
diff --git a/pySim/esim/saip/__init__.py b/pySim/esim/saip/__init__.py index c97195f..3828023 100644 --- a/pySim/esim/saip/__init__.py +++ b/pySim/esim/saip/__init__.py @@ -2040,7 +2040,8 @@ super().__init__(fid, parent, file, name)
def __str__(self): - return '%s(%s)' % (self.__class__.__name__, b2h(self.df_name)) + # self.df_name is usually None for an ADF like ADF.USIM or ADF.ISIM so we need to guard against it + return '%s(%s)' % (self.__class__.__name__, b2h(self.df_name) if self.df_name else None)
class FsNodeMF(FsNodeDF): """The MF (Master File) in the filesystem hierarchy."""