Skip to content

Commit 299e300

Browse files
committed
Use get_current_scope to see if it makes the bot happy
1 parent d9deb29 commit 299e300

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

sentry_sdk/integrations/aiohttp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,7 @@ async def sentry_urldispatcher_resolve(
314314
pass
315315

316316
if name is not None:
317-
current_scope = sentry_sdk.get_current_scope()
318-
current_span = current_scope.span
317+
current_span = sentry_sdk.get_current_span()
319318
if isinstance(current_span, StreamedSpan) and not isinstance(
320319
current_span, NoOpStreamedSpan
321320
):
@@ -325,6 +324,7 @@ async def sentry_urldispatcher_resolve(
325324
SEGMENT_SOURCE_FOR_STYLE[integration.transaction_style].value,
326325
)
327326
else:
327+
current_scope = sentry_sdk.get_current_scope()
328328
current_scope.set_transaction_name(
329329
name,
330330
source=SOURCE_FOR_STYLE[integration.transaction_style],

0 commit comments

Comments
 (0)