diff options
author | Daniel Eades <danieleades@hotmail.com> | 2022-01-10 13:51:35 +0000 |
---|---|---|
committer | Daniel Eades <danieleades@hotmail.com> | 2022-01-10 13:51:35 +0000 |
commit | 61ff90460d61a33a9187006fd199424b23e9fbd2 (patch) | |
tree | 7fca648bd26f8665722a5c59f9c1f424c5b5275c /sphinx/util/inspect.py | |
parent | 72d352f64ec97c2b15173cc1a191c0e80bde9630 (diff) | |
download | sphinx-git-61ff90460d61a33a9187006fd199424b23e9fbd2.tar.gz |
use 'callable' to check if object is callable (B004)
Diffstat (limited to 'sphinx/util/inspect.py')
-rw-r--r-- | sphinx/util/inspect.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sphinx/util/inspect.py b/sphinx/util/inspect.py index 763e39cc2..06920288f 100644 --- a/sphinx/util/inspect.py +++ b/sphinx/util/inspect.py @@ -301,7 +301,7 @@ def isstaticmethod(obj: Any, cls: Any = None, name: str = None) -> bool: def isdescriptor(x: Any) -> bool: """Check if the object is some kind of descriptor.""" for item in '__get__', '__set__', '__delete__': - if hasattr(safe_getattr(x, item, None), '__call__'): + if callable(safe_getattr(x, item, None)): return True return False |