Skip to content

Commit cd091d5

Browse files
committed
mypy
1 parent 2afd472 commit cd091d5

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

sentry_sdk/api.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,11 @@ def enable_integration(integration: Integration) -> None:
546546
:type integration: sentry_sdk.integrations.Integration
547547
"""
548548
client = get_client()
549+
if not client.is_active():
550+
return
551+
549552
integration = _enable_integration(integration)
550553
if integration is None:
551554
return
555+
552556
client.integrations[integration.identifier] = integration

sentry_sdk/client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ def __init__(self, options: "Optional[Dict[str, Any]]" = None) -> None:
188188
self.monitor: "Optional[Monitor]" = None
189189
self.log_batcher: "Optional[LogBatcher]" = None
190190
self.metrics_batcher: "Optional[MetricsBatcher]" = None
191+
self.integrations: "dict[str, Integration]" = {}
191192

192193
def __getstate__(self, *args: "Any", **kwargs: "Any") -> "Any":
193194
return {"options": {}}

0 commit comments

Comments
 (0)