Skip to content

Commit

Permalink
add SIM113 lint
Browse files Browse the repository at this point in the history
  • Loading branch information
danieleades committed Dec 31, 2022
1 parent 03c6244 commit bff3eb2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sphinx/environment/adapters/toctree.py
Expand Up @@ -209,9 +209,10 @@ def _entries_from_toctree(toctreenode: addnodes.toctree, parents: List[str],
if not (subtocnode.get('hidden', False) and
not includehidden):
i = subtocnode.parent.index(subtocnode) + 1
for entry in _entries_from_toctree(
subtocnode, [refdoc] + parents,
subtree=True):
entries = _entries_from_toctree(
subtocnode, [refdoc] + parents, subtree=True
)
for entry in entries:
subtocnode.parent.insert(i, entry)
i += 1
subtocnode.parent.remove(subtocnode)
Expand Down

0 comments on commit bff3eb2

Please sign in to comment.