mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Fix for asyncio.iscoroutinefunction deprecation warnings
Closes #2512 Refs https://github.com/simonw/asyncinject/issues/18
This commit is contained in:
parent
27084caa04
commit
e2a739c496
2 changed files with 4 additions and 4 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import asyncio
|
||||
import inspect
|
||||
import types
|
||||
from typing import NamedTuple, Any
|
||||
|
||||
|
|
@ -17,9 +17,9 @@ def check_callable(obj: Any) -> CallableStatus:
|
|||
return CallableStatus(True, False)
|
||||
|
||||
if isinstance(obj, types.FunctionType):
|
||||
return CallableStatus(True, asyncio.iscoroutinefunction(obj))
|
||||
return CallableStatus(True, inspect.iscoroutinefunction(obj))
|
||||
|
||||
if hasattr(obj, "__call__"):
|
||||
return CallableStatus(True, asyncio.iscoroutinefunction(obj.__call__))
|
||||
return CallableStatus(True, inspect.iscoroutinefunction(obj.__call__))
|
||||
|
||||
assert False, "obj {} is somehow callable with no __call__ method".format(repr(obj))
|
||||
|
|
|
|||
2
setup.py
2
setup.py
|
|
@ -58,7 +58,7 @@ setup(
|
|||
"mergedeep>=1.1.1",
|
||||
"itsdangerous>=1.1",
|
||||
"sqlite-utils>=3.30",
|
||||
"asyncinject>=0.5",
|
||||
"asyncinject>=0.6.1",
|
||||
"setuptools",
|
||||
"pip",
|
||||
],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue