mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Use safe_getattr()
to access __self__
.
This commit is contained in:
parent
439485e837
commit
9fd40d3ab3
@ -305,10 +305,7 @@ def isabstractmethod(obj: Any) -> bool:
|
|||||||
|
|
||||||
def isboundmethod(method: MethodType) -> bool:
|
def isboundmethod(method: MethodType) -> bool:
|
||||||
"""Check if the method is a bound method."""
|
"""Check if the method is a bound method."""
|
||||||
try:
|
return safe_getattr(method, '__self__', None) is not None
|
||||||
return method.__self__ is not None
|
|
||||||
except AttributeError:
|
|
||||||
return False
|
|
||||||
|
|
||||||
|
|
||||||
def is_cython_function_or_method(obj: Any) -> bool:
|
def is_cython_function_or_method(obj: Any) -> bool:
|
||||||
|
Loading…
Reference in New Issue
Block a user