Skip to content

Commit 91b05ed

Browse files
committed
chore: fix leaking processors bug generically
1 parent 16a9e6a commit 91b05ed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sentry_sdk/hub.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def __enter__(self):
4747
return self
4848

4949
def __exit__(self, exc_type, exc_value, tb):
50-
assert self._hub._stack.pop() == self._layer, "popped wrong scope"
50+
assert self._hub.pop_scope_unsafe() == self._layer, "popped wrong scope"
5151

5252

5353
class Hub(with_metaclass(HubMeta)):
@@ -175,7 +175,7 @@ def pop_scope_unsafe(self):
175175
"""Pops a scope layer from the stack. Try to use the context manager
176176
`push_scope()` instead."""
177177
self._pending_processors = []
178-
self._stack.pop()
178+
return self._stack.pop()
179179

180180
@contextmanager
181181
def configure_scope(self):

0 commit comments

Comments
 (0)