Skip to content

Commit e367e9c

Browse files
ptoscoTosco, Paolo
andauthored
Make sure splitlines is not called on None (#161)
Small change that avoids that `splitlines` is called on a `None` object; this may currently happen if `prop.fget.__doc__` exists and is `None`, thus causing an exception (`'NoneType' object has no attribute 'splitlines'`). Co-authored-by: Tosco, Paolo <[email protected]>
1 parent bbb1104 commit e367e9c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pybind11_stubgen/parser/mixins/parse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ def handle_property(self, path: QualifiedName, prop: Any) -> Property | None:
502502
result.doc == result.getter.doc
503503
or result.doc
504504
== self._strip_empty_lines(
505-
getattr(prop.fget, "__doc__", "").splitlines()
505+
(getattr(prop.fget, "__doc__", "") or "").splitlines()
506506
)
507507
)
508508
):

0 commit comments

Comments
 (0)