Skip to content

Commit f430c20

Browse files
authored
Fix _merge_scopes to work with PotelScope (#3499)
Fixes event processors such as WSGI request info addition.
1 parent 2725322 commit f430c20

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

sentry_sdk/scope.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,14 @@ def _merge_scopes(self, additional_scope=None, additional_scope_kwargs=None):
335335
if additional_scope and additional_scope_kwargs:
336336
raise TypeError("cannot provide scope and kwargs")
337337

338-
final_scope = copy(_global_scope) if _global_scope is not None else Scope()
338+
final_scope = self.__class__()
339339
final_scope._type = ScopeType.MERGED
340340

341+
global_scope = self.get_global_scope()
342+
final_scope.update_from_scope(global_scope)
343+
341344
isolation_scope = self.get_isolation_scope()
342-
final_scope.update_from_scope(isolation_scope)
345+
final_scope.update_from_scope(self.get_isolation_scope())
343346

344347
current_scope = self.get_current_scope()
345348
final_scope.update_from_scope(current_scope)

0 commit comments

Comments
 (0)