Skip to content

Commit 20cde02

Browse files
authored
docs: Fix linkcode_resolve (#652)
1 parent 51b84e7 commit 20cde02

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

docs/source/conf.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,11 @@ def linkcode_resolve(domain: str, info: dict[str, str]) -> str | None:
9494
if domain != "py" or not info["module"]:
9595
return None
9696

97-
obj = _get_obj(info)
97+
try:
98+
obj = _get_obj(info)
99+
except AttributeError:
100+
# This can happen when trying to get a field typed at the class level.
101+
return None
98102
file_name = _get_file_name(obj)
99103

100104
if not file_name:

0 commit comments

Comments
 (0)