Skip to content

Commit

Permalink
Merge pull request #9928 from joukewitteveen/patch-1
Browse files Browse the repository at this point in the history
doc: Fix autodoc extension example
  • Loading branch information
tk0miya authored Dec 4, 2021
2 parents 17dfa81 + bc849e2 commit 4d176d4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions doc/development/tutorials/examples/autodoc_intenum.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class IntEnumDocumenter(ClassDocumenter):
objtype = 'intenum'
directivetype = 'class'
directivetype = ClassDocumenter.objtype
priority = 10 + ClassDocumenter.priority
option_spec = dict(ClassDocumenter.option_spec)
option_spec['hex'] = bool_option
Expand All @@ -18,7 +18,10 @@ class IntEnumDocumenter(ClassDocumenter):
def can_document_member(cls,
member: Any, membername: str,
isattr: bool, parent: Any) -> bool:
return isinstance(member, IntEnum)
try:
return issubclass(member, IntEnum)
except TypeError:
return False

def add_directive_header(self, sig: str) -> None:
super().add_directive_header(sig)
Expand Down

0 comments on commit 4d176d4

Please sign in to comment.