Skip to content

Commit 1b635d1

Browse files
committed
feat: Small changes
1 parent 9e41b8b commit 1b635d1

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

sentry_minimal.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ def capture_exception(error=None):
3131

3232

3333
@public
34-
def add_breadcrumb(crumb):
34+
def add_breadcrumb(*args, **kwargs):
3535
hub = Hub.current
3636
if hub is not None:
37-
return hub.add_breadcrumb(crumb)
37+
return hub.add_breadcrumb(*args, **kwargs)
3838

3939

4040
@public
@@ -48,6 +48,11 @@ def configure_scope():
4848
yield Scope()
4949

5050

51+
@public
52+
def get_current_hub():
53+
return Hub.current
54+
55+
5156
try:
5257
from sentry_sdk import Hub, Scope
5358
except ImportError:

sentry_sdk/api.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
for _key in sentry_minimal.__all__:
1414
globals()[_key] = getattr(sentry_minimal, _key)
15+
globals()[_key].__module__ = __name__
16+
del _key
1517

1618

1719
class _InitGuard(object):

sentry_sdk/hub.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,12 @@ def add_breadcrumb(self, crumb):
144144

145145
def add_event_processor(self, factory):
146146
"""Registers a new event processor with the top scope."""
147-
self._pending_processors.append(factory)
147+
if self._stack[1][0] is not None:
148+
self._pending_processors.append(factory)
148149

149150
def push_scope(self):
150151
"""Pushes a new layer on the scope stack."""
152+
self._flush_event_processors()
151153
client, scope = self._stack[-1]
152154
self._stack.append((client, copy.copy(scope)))
153155
return _ScopeManager(self)

0 commit comments

Comments
 (0)