Skip to content

Commit be0f8e5

Browse files
committed
fix: fix mypy errors and switch comment-style type hints
1 parent 6292e79 commit be0f8e5

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

sentry_sdk/integrations/aiohttp.py

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

5757

58-
def create_trace_config() -> TraceConfig:
59-
async def on_request_start(
60-
session: ClientSession,
61-
trace_config_ctx: "SimpleNamespace",
62-
params: "TraceRequestStartParams",
63-
):
58+
def create_trace_config():
59+
# type: () -> TraceConfig
60+
async def on_request_start(session, trace_config_ctx, params):
61+
# type: (ClientSession, SimpleNamespace, TraceRequestStartParams) -> None
6462
hub = Hub.current
6563
if hub.get_integration(AioHttpIntegration) is None:
6664
return
@@ -84,11 +82,8 @@ async def on_request_start(
8482

8583
trace_config_ctx.span = span
8684

87-
async def on_request_end(
88-
session: ClientSession,
89-
trace_config_ctx: "SimpleNamespace",
90-
params: "TraceRequestEndParams",
91-
):
85+
async def on_request_end(session, trace_config_ctx, params):
86+
# type: (ClientSession, SimpleNamespace, TraceRequestEndParams) -> None
9287
if trace_config_ctx.span is None:
9388
return
9489

@@ -223,6 +218,7 @@ async def sentry_urldispatcher_resolve(self, request):
223218
old_client_session_init = ClientSession.__init__
224219

225220
def init(*args, **kwargs):
221+
# type: (Any, Any) -> ClientSession
226222
hub = Hub.current
227223
if hub.get_integration(AioHttpIntegration) is None:
228224
return old_client_session_init(*args, **kwargs)

0 commit comments

Comments
 (0)