Skip to content

Commit

Permalink
sphinx: remove lines from the end
Browse files Browse the repository at this point in the history
As lines are removed, the `enumerate` indices are offset for
after-the-first removals. Iterate from the end instead.
  • Loading branch information
mathstuf committed Feb 20, 2025
1 parent 09a626b commit bd620d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Utilities/Sphinx/config/conf.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def remove_common_doc(common_str, docstringlines):
if common_str in docstring:
#Remove the line with genstring
dsl = list(docstringlines)
for num,line in enumerate(dsl):
for num,line in reversed(list(enumerate(dsl))):
if common_str in line:
docstringlines.pop(num)

Expand Down

0 comments on commit bd620d3

Please sign in to comment.