Skip to content

Commit 705890b

Browse files
committed
Address comments in PR
1 parent 596ffba commit 705890b

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

cuda_python/docs/exts/release_toc.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@ def parse_content(self, toctree):
1616
if not toctree["glob"]:
1717
return
1818

19-
toctree["entries"] = [
20-
(Version(Path(x[1]).name.removesuffix("-notes")), x[1]) for x in toctree.get("entries", [])
21-
]
22-
toctree["entries"].sort(key=lambda x: x[0], reverse=True)
23-
toctree["entries"] = [(str(x[0]), x[1]) for x in toctree["entries"]]
19+
entries = toctree.get("entries", [])
20+
if not entries:
21+
return
22+
23+
entries = [(Version(Path(x[1]).name.removesuffix("-notes")), x[1]) for x in entries]
24+
entries.sort(key=lambda x: x[0], reverse=True)
25+
entries = [(str(x[0]), x[1]) for x in entries]
26+
toctree["entries"] = entries
2427

2528

2629
def setup(app):

0 commit comments

Comments
 (0)