Skip to content

Commit e352a67

Browse files
picnixzAA-Turner
andauthored
Improve sphinx.util.inspect (#12256)
Co-authored-by: Adam Turner <[email protected]>
1 parent 6730392 commit e352a67

File tree

2 files changed

+300
-241
lines changed

2 files changed

+300
-241
lines changed

sphinx/ext/autodoc/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2438,8 +2438,8 @@ def get_doc(self) -> list[list[str]] | None:
24382438
if self.object is SLOTSATTR:
24392439
try:
24402440
parent___slots__ = inspect.getslots(self.parent)
2441-
if parent___slots__ and parent___slots__.get(self.objpath[-1]):
2442-
docstring = prepare_docstring(parent___slots__[self.objpath[-1]])
2441+
if parent___slots__ and (docstring := parent___slots__.get(self.objpath[-1])):
2442+
docstring = prepare_docstring(docstring)
24432443
return [docstring]
24442444
else:
24452445
return []

0 commit comments

Comments
 (0)