Skip to content
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