Skip to content

Commit b5868f8

Browse files
committed
fix: Don't allow None for a property's docstring
1 parent bfb88b8 commit b5868f8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/pytkdocs/loader.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ def get_function_documentation(self, node: ObjectNode) -> Function:
387387
name=node.name,
388388
path=node.dotted_path,
389389
file_path=node.file_path,
390-
docstring=inspect.getdoc(function),
390+
docstring=inspect.getdoc(function) or "",
391391
signature=signature,
392392
source=source,
393393
)
@@ -425,7 +425,7 @@ def get_property_documentation(self, node: ObjectNode) -> Attribute:
425425
name=node.name,
426426
path=path,
427427
file_path=node.file_path,
428-
docstring=inspect.getdoc(prop.fget),
428+
docstring=inspect.getdoc(prop.fget) or "",
429429
attr_type=attr_type,
430430
properties=properties,
431431
source=source,
@@ -555,7 +555,7 @@ def get_method_documentation(self, node: ObjectNode, properties: Optional[List[s
555555
name=node.name,
556556
path=path,
557557
file_path=node.file_path,
558-
docstring=inspect.getdoc(method),
558+
docstring=inspect.getdoc(method) or "",
559559
signature=inspect.signature(method),
560560
properties=properties or [],
561561
source=source,

0 commit comments

Comments
 (0)