Skip to content

Commit 12ff4bd

Browse files
committed
Fix exception if init doesnt have a module
1 parent 8c2bb5f commit 12ff4bd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/lazydocs/generation.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,10 @@ def class2md(self, cls: Any, depth: int = 2) -> str:
582582

583583
try:
584584
# object module should be the same as the calling module
585-
if cls.__init__.__module__ == modname:
585+
if (
586+
hasattr(cls.__init__, "__module__")
587+
and cls.__init__.__module__ == modname
588+
):
586589
init = self.func2md(cls.__init__, clsname=clsname)
587590
else:
588591
init = ""

0 commit comments

Comments
 (0)