Skip to content

Commit

Permalink
Improve sphinx.util.inspect (#12256)
Browse files Browse the repository at this point in the history
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
  • Loading branch information
picnixz and AA-Turner committed Apr 13, 2024
1 parent 6730392 commit e352a67
Show file tree
Hide file tree
Showing 2 changed files with 300 additions and 241 deletions.
4 changes: 2 additions & 2 deletions sphinx/ext/autodoc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2438,8 +2438,8 @@ def get_doc(self) -> list[list[str]] | None:
if self.object is SLOTSATTR:
try:
parent___slots__ = inspect.getslots(self.parent)
if parent___slots__ and parent___slots__.get(self.objpath[-1]):
docstring = prepare_docstring(parent___slots__[self.objpath[-1]])
if parent___slots__ and (docstring := parent___slots__.get(self.objpath[-1])):
docstring = prepare_docstring(docstring)
return [docstring]
else:
return []
Expand Down

0 comments on commit e352a67

Please sign in to comment.