Skip to content

Commit

Permalink
Merge pull request #9530 from tacaswell/fix_numpy_class_attribute
Browse files Browse the repository at this point in the history
FIX: do not try to compute the boolean value of a numpy array
  • Loading branch information
tk0miya committed Aug 10, 2021
2 parents 8948f45 + 2232d94 commit c66b3ad
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sphinx/util/inspect.py
Expand Up @@ -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
Expand Down

0 comments on commit c66b3ad

Please sign in to comment.