diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-10-29 20:01:38 +0300 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-10-29 20:01:38 +0300 |
commit | 3c5b31b50d48fce2e2b7d2f950321e608d5bae00 (patch) | |
tree | f6dce322d8b0097d23199d2270f1a5fd80cc433f /sphinx/util | |
parent | 4c91c038b220d07bbdfe0c1680af42fe897f342c (diff) |
Fix #9757: autodoc_inherit_docstrings does not effect to overriden classmethods
Diffstat (limited to 'sphinx/util')
-rw-r--r-- | sphinx/util/inspect.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sphinx/util/inspect.py b/sphinx/util/inspect.py index 6a89d20e0..7e45fe322 100644 --- a/sphinx/util/inspect.py +++ b/sphinx/util/inspect.py @@ -866,7 +866,9 @@ def getdoc(obj: Any, attrgetter: Callable = safe_getattr, for basecls in getmro(cls): meth = basecls.__dict__.get(name) if meth and hasattr(meth, '__func__'): - return getdoc(meth.__func__) + doc = getdoc(meth.__func__) + if doc is not None or not allow_inherited: + return doc doc = attrgetter(obj, '__doc__', None) if ispartial(obj) and doc == obj.__class__.__doc__: |