Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sphinx-doc/sphinx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2021-10-22 20:14:57 +0300
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2021-10-22 20:14:57 +0300
commitced8895b127c6ea84c74dc4df495d0f5e2560d74 (patch)
treeb28daf6e633594c222eba2b5def2832e359ac617 /sphinx/util
parent6472fb92244f2c8384e0a1b299109398e0e10a52 (diff)
Fix #9756: autodoc: Crashed if classmethod does not have __func__ attribute
Diffstat (limited to 'sphinx/util')
-rw-r--r--sphinx/util/inspect.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/sphinx/util/inspect.py b/sphinx/util/inspect.py
index 4482f2087..6a89d20e0 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)