Skip to content

Commit 0257174

Browse files
committed
Handle if ClassDocumenter is used for singletons
1 parent ed472b3 commit 0257174

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scanpydoc/elegant_typehints/autodoc_patch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def add_directive_header(self: ClassDocumenter, sig: str) -> None:
1515
lines: StringList = self.directive.result
1616
role, direc = (
1717
("exc", "exception")
18-
if issubclass(self.object, BaseException)
18+
if isinstance(self.object, type) and issubclass(self.object, BaseException)
1919
else ("class", "class")
2020
)
2121
for old, new in qualname_overrides.items():

0 commit comments

Comments
 (0)