Skip to content

Commit

Permalink
fix ruff preview error: B909 Mutation to loop iterable during iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
ilius committed Sep 5, 2024
1 parent 9df1ed6 commit 69bcbf9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyglossary/core_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pyglossary/plugins/appledict_bin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down

0 comments on commit 69bcbf9

Please sign in to comment.