From 4dc6eb37ca7febe583f7a6809dbc9e82ae5e758a Mon Sep 17 00:00:00 2001 From: Simon Kallweit Date: Fri, 16 Feb 2024 10:15:20 +0100 Subject: [PATCH] improve docstring generation --- nanobind_stubgen/NanobindStubsGenerator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nanobind_stubgen/NanobindStubsGenerator.py b/nanobind_stubgen/NanobindStubsGenerator.py index 5f55a20..5555750 100644 --- a/nanobind_stubgen/NanobindStubsGenerator.py +++ b/nanobind_stubgen/NanobindStubsGenerator.py @@ -40,7 +40,7 @@ def _create_doc(self, doc_str: Optional[str] = None) -> List[str]: doc_str = self.obj.__doc__ # split doc string for per-line indentation - doc_str = str(doc_str).strip() + doc_str = doc_str.strip() if type(doc_str) == str else "" doc_lines = [l.strip() for l in doc_str.split("\n")] if doc_str is not None and str(doc_str).strip() != "":