Skip to content

Commit 7d84415

Browse files
committed
fix RubricCollector.clear_doc()
1 parent 26cdabb commit 7d84415

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

exts/ferrocene_spec/items_with_rubric.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,7 @@ class RubricCollector(EnvironmentCollector):
4040
def clear_doc(self, app, env, docname):
4141
storage = get_storage(env)
4242
for rubric, items in storage.items():
43-
# This makes a copy of the list (with `list(items)`) to be able to
44-
# remove items from it without affecting the iteration.
45-
for i, item in enumerate(list(items)):
46-
if item.document == docname:
47-
items.pop(i)
43+
items[:] = (item for item in items if item.document != docname)
4844

4945
def merge_other(self, app, env, docnames, other):
5046
current = get_storage(env)

0 commit comments

Comments
 (0)