diff --git a/pyglossary/core_test.py b/pyglossary/core_test.py index c02deac96..22a29b027 100644 --- a/pyglossary/core_test.py +++ b/pyglossary/core_test.py @@ -25,7 +25,7 @@ def popLog(self, level: int, msg: str, partial=False) -> "logging.LogRecord | No if level not in self.recordsByLevel: return None records = self.recordsByLevel[level] - for index, record in enumerate(records): + for index, record in list(enumerate(records)): rec_msg = record.getMessage() if msg == rec_msg or (msg in rec_msg and partial): return records.pop(index) diff --git a/pyglossary/plugins/appledict_bin/__init__.py b/pyglossary/plugins/appledict_bin/__init__.py index c55887570..b87ac8488 100644 --- a/pyglossary/plugins/appledict_bin/__init__.py +++ b/pyglossary/plugins/appledict_bin/__init__.py @@ -344,7 +344,7 @@ def _getDefi( ) entryElem.tag = "div" - for attr in entryElem.attrib: + for attr in list(entryElem.attrib.keys()): # if attr == "id" or attr.endswith("title"): del entryElem.attrib[attr]