Bjoern Riemer has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/26958 )
Change subject: catch and ignore SwMatchError on probing for AID's ......................................................................
catch and ignore SwMatchError on probing for AID's
When probing applications on a card by running select_adf_by_aid() SwMatchError exceptions indicating the non exsistance of that application on the card should be ignored.
Change-Id: I3aa7deaf46bdf352a201c3089b3714405a06f281 --- M pySim/filesystem.py 1 file changed, 7 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/58/26958/1
diff --git a/pySim/filesystem.py b/pySim/filesystem.py index dfe1677..32688db 100644 --- a/pySim/filesystem.py +++ b/pySim/filesystem.py @@ -1113,11 +1113,13 @@ # Some card applications may not be registered in EF.DIR, we will actively # probe for those applications for f in set(apps_profile) - set(apps_taken): - data, sw = self.card.select_adf_by_aid(f.aid) - if sw == "9000": - print(" %s: %s" % (f.name, f.aid)) - apps_taken.append(f) - + try: + data, sw = self.card.select_adf_by_aid(f.aid) + if sw == "9000": + print(" %s: %s" % (f.name, f.aid)) + apps_taken.append(f) + except SwMatchError: + pass return apps_taken
def reset(self, cmd_app=None) -> Hexstr: