From 5c17491a45363eb0c408eb4d3ada3a93098dfa82 Mon Sep 17 00:00:00 2001 From: Anton Pirker Date: Mon, 20 Nov 2023 11:43:13 +0100 Subject: [PATCH] Fix Quart integration for Quart 0.19.4 (#2516) * is_coroutine_function was removed from quart, taking from asyncio directly --- sentry_sdk/integrations/quart.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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):