From 0f31135cc0773a819c036ddcaad6862d7547f90a Mon Sep 17 00:00:00 2001 From: pgjones Date: Sun, 1 Oct 2023 17:31:53 +0100 Subject: [PATCH] Support Quart 0.19 onwards Quart 0.19 is based on Flask and hence no longer has a Scaffold class, instead Flask's should be used. --- sentry_sdk/integrations/quart.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sentry_sdk/integrations/quart.py b/sentry_sdk/integrations/quart.py index ea874ed37c..38420ec795 100644 --- a/sentry_sdk/integrations/quart.py +++ b/sentry_sdk/integrations/quart.py @@ -38,7 +38,6 @@ request, websocket, ) - from quart.scaffold import Scaffold # type: ignore from quart.signals import ( # type: ignore got_background_exception, got_request_exception, @@ -49,6 +48,12 @@ from quart.utils import is_coroutine_function # type: ignore except ImportError: raise DidNotEnable("Quart is not installed") +else: + # Quart 0.19 is based on Flask and hence no longer has a Scaffold + try: + from quart.scaffold import Scaffold # type: ignore + except ImportError: + from flask.sansio.scaffold import Scaffold # type: ignore TRANSACTION_STYLE_VALUES = ("endpoint", "url")