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-08-10 20:18:23 +0300
committerGitHub <noreply@github.com>2021-08-10 20:18:23 +0300
commitc66b3ad519ed91e79205ee973bfdba17fc06453f (patch)
tree1a986fea6815fa55d82963f1d5efc7d60c6976f3 /sphinx/util
parent8948f45226a5f0241b7616b784774a170525d91f (diff)
parent2232d9430c48afe771fce2b5b53a58611c036204 (diff)
Merge pull request #9530 from tacaswell/fix_numpy_class_attribute
FIX: do not try to compute the boolean value of a numpy array
Diffstat (limited to 'sphinx/util')
-rw-r--r--sphinx/util/inspect.py5
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