File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import asyncio
22import inspect
3+ import sys
34from functools import wraps
45
56import sentry_sdk
@@ -100,15 +101,19 @@ async def sentry_patched_asgi_app(
100101
101102
102103def patch_scaffold_route () -> None :
104+ # Vendored: https://github.com/pallets/quart/blob/5817e983d0b586889337a596d674c0c246d68878/src/quart/app.py#L137-L140
105+ if sys .version_info >= (3 , 12 ):
106+ iscoroutinefunction = inspect .iscoroutinefunction
107+ else :
108+ iscoroutinefunction = asyncio .iscoroutinefunction
109+
103110 old_route = Scaffold .route
104111
105112 def _sentry_route (* args : "Any" , ** kwargs : "Any" ) -> "Any" :
106113 old_decorator = old_route (* args , ** kwargs )
107114
108115 def decorator (old_func : "Any" ) -> "Any" :
109- if inspect .isfunction (old_func ) and not asyncio .iscoroutinefunction (
110- old_func
111- ):
116+ if inspect .isfunction (old_func ) and not iscoroutinefunction (old_func ):
112117
113118 @wraps (old_func )
114119 @ensure_integration_enabled (QuartIntegration , old_func )
You can’t perform that action at this time.
0 commit comments