Skip to content

Commit c66b3ad

Browse files
authored
Merge pull request #9530 from tacaswell/fix_numpy_class_attribute
FIX: do not try to compute the boolean value of a numpy array
2 parents 8948f45 + 2232d94 commit c66b3ad

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sphinx/util/inspect.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,10 @@ def isclassmethod(obj: Any, cls: Any = None, name: str = None) -> bool:
255255
elif inspect.ismethod(obj) and obj.__self__ is not None and isclass(obj.__self__):
256256
return True
257257
elif cls and name:
258+
placeholder = object()
258259
for basecls in getmro(cls):
259-
meth = basecls.__dict__.get(name)
260-
if meth:
260+
meth = basecls.__dict__.get(name, placeholder)
261+
if meth is not placeholder:
261262
return isclassmethod(meth)
262263

263264
return False

0 commit comments

Comments
 (0)