diff --git a/CHANGES b/CHANGES index 29f00b5849b..4c11f90f723 100644 --- a/CHANGES +++ b/CHANGES @@ -63,6 +63,7 @@ Bugs fixed generic class * #9755: autodoc: memory addresses are shown for aliases * #9752: autodoc: Failed to detect type annotation for slots attribute +* #9756: autodoc: Crashed if classmethod does not have __func__ attribute * #9630: autosummary: Failed to build summary table if :confval:`primary_domain` is not 'py' * #9670: html: Fix download file with special characters diff --git a/sphinx/util/inspect.py b/sphinx/util/inspect.py index 4482f20872f..6a89d20e067 100644 --- a/sphinx/util/inspect.py +++ b/sphinx/util/inspect.py @@ -865,7 +865,7 @@ def getdoc(obj: Any, attrgetter: Callable = safe_getattr, if cls and name and isclassmethod(obj, cls, name): for basecls in getmro(cls): meth = basecls.__dict__.get(name) - if meth: + if meth and hasattr(meth, '__func__'): return getdoc(meth.__func__) doc = attrgetter(obj, '__doc__', None)