From cbc6f4e8c91943a745176ade74b47af9a899ce9e Mon Sep 17 00:00:00 2001 From: Daniel Stock Date: Fri, 26 Jun 2020 22:49:02 +0200 Subject: [PATCH] Modifying dict while iterating over it creates runtime error in Python 3.8, dict is converted to list for fix. --- msb_client/MsbClient.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/msb_client/MsbClient.py b/msb_client/MsbClient.py index 0224379..a659c8d 100644 --- a/msb_client/MsbClient.py +++ b/msb_client/MsbClient.py @@ -790,7 +790,7 @@ def getSelfDescription(self): e = jsonpickle.decode( jsonpickle.encode(self.events[event], unpicklable=False) ) - for key in e.keys(): + for key in list(e.keys()): if key == "id": e["@id"] = e["id"] del e[key] @@ -799,7 +799,7 @@ def getSelfDescription(self): if e["dataFormat"] is None: del e["dataFormat"] del e["isArray"] - for key in e.keys(): + for key in list(e.keys()): current_e_props.append(key) for key in current_e_props: if key not in e_props: