diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-08-10 20:18:23 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-10 20:18:23 +0300 |
commit | c66b3ad519ed91e79205ee973bfdba17fc06453f (patch) | |
tree | 1a986fea6815fa55d82963f1d5efc7d60c6976f3 | |
parent | 8948f45226a5f0241b7616b784774a170525d91f (diff) | |
parent | 2232d9430c48afe771fce2b5b53a58611c036204 (diff) |
Merge pull request #9530 from tacaswell/fix_numpy_class_attribute
FIX: do not try to compute the boolean value of a numpy array
-rw-r--r-- | sphinx/util/inspect.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sphinx/util/inspect.py b/sphinx/util/inspect.py index 2bb900bd7..d55ebceec 100644 --- a/sphinx/util/inspect.py +++ b/sphinx/util/inspect.py @@ -255,9 +255,10 @@ def isclassmethod(obj: Any, cls: Any = None, name: str = None) -> bool: elif inspect.ismethod(obj) and obj.__self__ is not None and isclass(obj.__self__): return True elif cls and name: + placeholder = object() for basecls in getmro(cls): - meth = basecls.__dict__.get(name) - if meth: + meth = basecls.__dict__.get(name, placeholder) + if meth is not placeholder: return isclassmethod(meth) return False |