laforge has uploaded this change for review.

View Change

pySim.app: Properly reset card state after reading EID

The code had two problems:

* the RESET was only performed in the successful case, but not if
some exceptio was raised

* the RESET was a low-level reset bypassing the RuntimeState,
so the lchan.selected_file was stale afterwards

Fixes: Change-Id Idc2ea1d9263f39b3dff403e1535a5e6c4e88b26f

Change-Id: Ib23d3d5b58b456a25157a622c1010c81cd8b2213
---
M pySim/app.py
1 file changed, 2 insertions(+), 1 deletion(-)

git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/53/38053/1
diff --git a/pySim/app.py b/pySim/app.py
index 5525cd1..5a93f98 100644
--- a/pySim/app.py
+++ b/pySim/app.py
@@ -116,6 +116,7 @@
except SwMatchError:
# has ISD-R but not a SGP.22/SGP.32 eUICC - maybe SGP.02?
pass
- card.reset()
+ finally:
+ rs.reset()

return rs, card

To view, visit change 38053. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ib23d3d5b58b456a25157a622c1010c81cd8b2213
Gerrit-Change-Number: 38053
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge@osmocom.org>