mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #9760 from tk0miya/9756_classmethod_not_having_func
Fix #9756: autodoc: Crashed if classmethod does not have __func__ attribute
This commit is contained in:
commit
a16baf1495
1
CHANGES
1
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
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user