diff --git a/sentry_sdk/integrations/quart.py b/sentry_sdk/integrations/quart.py index 38420ec795..4dee751d65 100644 --- a/sentry_sdk/integrations/quart.py +++ b/sentry_sdk/integrations/quart.py @@ -1,5 +1,6 @@ from __future__ import absolute_import +import asyncio import inspect import threading @@ -45,7 +46,6 @@ request_started, websocket_started, ) - from quart.utils import is_coroutine_function # type: ignore except ImportError: raise DidNotEnable("Quart is not installed") else: @@ -113,7 +113,9 @@ def _sentry_route(*args, **kwargs): def decorator(old_func): # type: (Any) -> Any - if inspect.isfunction(old_func) and not is_coroutine_function(old_func): + if inspect.isfunction(old_func) and not asyncio.iscoroutinefunction( + old_func + ): @wraps(old_func) def _sentry_func(*args, **kwargs):