Skip to content

Commit 7423d8a

Browse files
mypy
1 parent 463375e commit 7423d8a

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

sentry_sdk/integrations/threading.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,15 +150,13 @@ def sentry_submit(self, fn, *args, **kwargs):
150150
if integration is None:
151151
return func(self, fn, *args, **kwargs)
152152

153-
if integration.propagate_scope:
154-
isolation_scope = sentry_sdk.get_isolation_scope().fork()
155-
current_scope = sentry_sdk.get_current_scope().fork()
156-
else:
157-
isolation_scope = None
158-
current_scope = None
159-
160153
def wrapped_fn(*args, **kwargs):
161154
# type: (*Any, **Any) -> Any
155+
if not integration.propagate_scope:
156+
return fn(*args, **kwargs)
157+
158+
isolation_scope = sentry_sdk.get_isolation_scope().fork()
159+
current_scope = sentry_sdk.get_current_scope().fork()
162160
with use_isolation_scope(isolation_scope):
163161
with use_scope(current_scope):
164162
return fn(*args, **kwargs)

0 commit comments

Comments
 (0)