Skip to content

Commit 8903c06

Browse files
committed
writedown
1 parent d0db5af commit 8903c06

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

sentry_sdk/integrations/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from threading import Lock
33
from typing import TYPE_CHECKING
44

5-
import sentry_sdk
65
from sentry_sdk.utils import logger
76

87
if TYPE_CHECKING:

sentry_sdk/integrations/asyncio.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,8 @@ async def async_entrypoint():
164164
165165
Any arguments provided will be passed to AsyncioIntegration() as is.
166166
167-
If AsyncioIntegration is already enabled on the current client (e.g. because
168-
it was provided in sentry_sdk.init(integrations=[...])), this function won't
169-
have any effect.
167+
If AsyncioIntegration has already patched the current event loop, this
168+
function won't have any effect.
170169
171170
If AsyncioIntegration was provided in
172171
sentry_sdk.init(disabled_integrations=[...]), this function will ignore that
@@ -176,6 +175,12 @@ async def async_entrypoint():
176175
if not client.is_active():
177176
return
178177

178+
# This function purposefully bypasses the integration machinery in
179+
# integrations/__init__.py. _installed_integrations/_processed_integrations
180+
# is used to prevent double patching the same module, but in the case of
181+
# the AsyncioIntegration, we don't monkeypatch the standard library directly,
182+
# we patch the currently running event loop, and we keep the record of doing
183+
# that on the loop itself.
179184
logger.debug("Setting up integration asyncio")
180185
integration = AsyncioIntegration(*args, **kwargs)
181186
integration.setup_once()

0 commit comments

Comments
 (0)