We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 596ffba commit 705890bCopy full SHA for 705890b
cuda_python/docs/exts/release_toc.py
@@ -16,11 +16,14 @@ def parse_content(self, toctree):
16
if not toctree["glob"]:
17
return
18
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"]]
+ entries = toctree.get("entries", [])
+ if not entries:
+ return
+
+ 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
27
28
29
def setup(app):
0 commit comments