Skip to content

Fix _merge_scopes to work with PotelScope #3499

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions sentry_sdk/scope.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,14 @@ def _merge_scopes(self, additional_scope=None, additional_scope_kwargs=None):
if additional_scope and additional_scope_kwargs:
raise TypeError("cannot provide scope and kwargs")

final_scope = copy(_global_scope) if _global_scope is not None else Scope()
final_scope = self.__class__()
final_scope._type = ScopeType.MERGED

global_scope = self.get_global_scope()
final_scope.update_from_scope(global_scope)

isolation_scope = self.get_isolation_scope()
final_scope.update_from_scope(isolation_scope)
final_scope.update_from_scope(self.get_isolation_scope())

current_scope = self.get_current_scope()
final_scope.update_from_scope(current_scope)
Expand Down
Loading