mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
bpo-37251: Removes __code__ check from _is_async_obj. (GH-15830)
This commit is contained in:
parent
5a7d2e11aa
commit
f1a297acb6
3 changed files with 20 additions and 3 deletions
|
@ -46,10 +46,9 @@ FILTER_DIR = True
|
|||
_safe_super = super
|
||||
|
||||
def _is_async_obj(obj):
|
||||
if getattr(obj, '__code__', None):
|
||||
return asyncio.iscoroutinefunction(obj) or inspect.isawaitable(obj)
|
||||
else:
|
||||
if _is_instance_mock(obj) and not isinstance(obj, AsyncMock):
|
||||
return False
|
||||
return asyncio.iscoroutinefunction(obj) or inspect.isawaitable(obj)
|
||||
|
||||
|
||||
def _is_async_func(func):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue