Skip to content

Commit 0f31135

Browse files
committed
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.
1 parent afc488d commit 0f31135

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

sentry_sdk/integrations/quart.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
request,
3939
websocket,
4040
)
41-
from quart.scaffold import Scaffold # type: ignore
4241
from quart.signals import ( # type: ignore
4342
got_background_exception,
4443
got_request_exception,
@@ -49,6 +48,12 @@
4948
from quart.utils import is_coroutine_function # type: ignore
5049
except ImportError:
5150
raise DidNotEnable("Quart is not installed")
51+
else:
52+
# Quart 0.19 is based on Flask and hence no longer has a Scaffold
53+
try:
54+
from quart.scaffold import Scaffold # type: ignore
55+
except ImportError:
56+
from flask.sansio.scaffold import Scaffold # type: ignore
5257

5358
TRANSACTION_STYLE_VALUES = ("endpoint", "url")
5459

0 commit comments

Comments
 (0)