Skip to content

Commit

Permalink
Fix exception if init doesnt have a module
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasmasuch committed Nov 25, 2020
1 parent 8c2bb5f commit 12ff4bd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lazydocs/generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,10 @@ def class2md(self, cls: Any, depth: int = 2) -> str:

try:
# object module should be the same as the calling module
if cls.__init__.__module__ == modname:
if (
hasattr(cls.__init__, "__module__")
and cls.__init__.__module__ == modname
):
init = self.func2md(cls.__init__, clsname=clsname)
else:
init = ""
Expand Down

0 comments on commit 12ff4bd

Please sign in to comment.