Skip to content

Commit 3a6198f

Browse files
author
Matthieu Devlin
committed
fix: fix mypy errors and switch comment-style type hints
1 parent 109be3a commit 3a6198f

1 file changed

Lines changed: 7 additions & 11 deletions

File tree

sentry_sdk/integrations/aiohttp.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,10 @@
5353
TRANSACTION_STYLE_VALUES = ("handler_name", "method_and_path_pattern")
5454

5555

56-
def create_trace_config() -> TraceConfig:
57-
async def on_request_start(
58-
session: ClientSession,
59-
trace_config_ctx: "SimpleNamespace",
60-
params: "TraceRequestStartParams",
61-
):
56+
def create_trace_config():
57+
# type: () -> TraceConfig
58+
async def on_request_start(session, trace_config_ctx, params):
59+
# type: (ClientSession, SimpleNamespace, TraceRequestStartParams) -> None
6260
hub = Hub.current
6361
if hub.get_integration(AioHttpIntegration) is None:
6462
return
@@ -82,11 +80,8 @@ async def on_request_start(
8280

8381
trace_config_ctx.span = span
8482

85-
async def on_request_end(
86-
session: ClientSession,
87-
trace_config_ctx: "SimpleNamespace",
88-
params: "TraceRequestEndParams",
89-
):
83+
async def on_request_end(session, trace_config_ctx, params):
84+
# type: (ClientSession, SimpleNamespace, TraceRequestEndParams) -> None
9085
if trace_config_ctx.span is None:
9186
return
9287

@@ -221,6 +216,7 @@ async def sentry_urldispatcher_resolve(self, request):
221216
old_client_session_init = ClientSession.__init__
222217

223218
def init(*args, **kwargs):
219+
# type: (Any, Any) -> ClientSession
224220
hub = Hub.current
225221
if hub.get_integration(AioHttpIntegration) is None:
226222
return old_client_session_init(*args, **kwargs)

0 commit comments

Comments
 (0)