aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2022-07-27 18:37:40 +0200
committerHarald Welte <laforge@osmocom.org>2022-07-30 16:37:01 +0200
commit7416d463a4081cfbfdd681db22650dd6c5b7a2b9 (patch)
treec28692775be7683b2a123511112686ad70459db2
parent93c34aac898d0fd39e227e7f11695d83e0873a6b (diff)
Fix printing of SwMatchError after introduction of logical channels
the interpret_sw() method was moved from RuntimeState to RuntimeLchan in Change-Id I7aa994b625467d4e46a2edd8123240b930305360 - but the code in pySim/exceptions.py was not adjusted accordingly. Change-Id: I0614436c99c6a6ebc22c4dc14fb361c5f5f16686
-rw-r--r--pySim/exceptions.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pySim/exceptions.py b/pySim/exceptions.py
index 24aff85..c6a81a1 100644
--- a/pySim/exceptions.py
+++ b/pySim/exceptions.py
@@ -53,8 +53,8 @@ class SwMatchError(Exception):
self.rs = rs
def __str__(self):
- if self.rs:
- r = self.rs.interpret_sw(self.sw_actual)
+ if self.rs and self.rs.lchan[0]:
+ r = self.rs.lchan[0].interpret_sw(self.sw_actual)
if r:
return "SW match failed! Expected %s and got %s: %s - %s" % (self.sw_expected, self.sw_actual, r[0], r[1])
return "SW match failed! Expected %s and got %s." % (self.sw_expected, self.sw_actual)