Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
456: Fix RubricCollector.clear_doc() r=tshepang a=mattheww I've seen occasional errors like the following on incremental builds: ```` Extension error (ferrocene_spec.items_with_rubric): Handler <bound method RubricCollector.clear_doc of <ferrocene_spec.items_with_rubric.RubricCollector object at 0x7f4a44a47e50>> for event 'env-purge-doc' threw an exception (exception: pop index out of range) ```` The following code in `exts/ferrocene_spec/items_with_rubric.py` ```` # This makes a copy of the list (with `list(items)`) to be able to # remove items from it without affecting the iteration. for i, item in enumerate(list(items)): if item.document == docname: items.pop(i) ```` won't work as intended if it finds more than one item to remove, because the first `pop` will change the positions of the following elements of the list. Co-authored-by: Matthew Woodcraft <[email protected]>
- Loading branch information