mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-17 02:48:34 +03:00
runtime: fix lchan deletion in method reset
When we perform a reset while multiple channels are open (this is in particular the case when parsing real world traces with pySim-trace). To delete those channels during the reset we iterate over the dictionary using the keys and delete the channels one by one. However, this must not be done using the keys as index directly. Python will then throw an exception: "RuntimeError: dictionary changed size during iteration". Instead using the keys directly we should cast them into a list and then using that list for the iteration. Related: OS#6094 Change-Id: I430ef216cf847ffbde2809f492ee9ed9030343b6
This commit is contained in:
@@ -124,7 +124,7 @@ class RuntimeState:
|
||||
cmd_app : Command Application State (for unregistering old file commands)
|
||||
"""
|
||||
# delete all lchan != 0 (basic lchan)
|
||||
for lchan_nr in self.lchan.keys():
|
||||
for lchan_nr in list(self.lchan.keys()):
|
||||
if lchan_nr == 0:
|
||||
continue
|
||||
del self.lchan[lchan_nr]
|
||||
|
||||
Reference in New Issue
Block a user