Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions sentry_sdk/__init__.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
from sentry_sdk import integrations, logger, profiler
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Circular Import in Sentry SDK Initialization

A circular import occurs in sentry_sdk/__init__.py where it attempts to import integrations, logger, and profiler from the sentry_sdk package itself. This happens during the package's initialization, which can cause ImportError or unexpected behavior.

Fix in Cursor Fix in Web

from sentry_sdk.scope import Scope
from sentry_sdk.transport import Transport, HttpTransport
from sentry_sdk.client import Client

from sentry_sdk.api import * # noqa

from sentry_sdk.consts import VERSION # noqa
from sentry_sdk.consts import VERSION

__all__ = [ # noqa
"Hub",
"Scope",
"Client",
"Transport",
"HttpTransport",
"VERSION",
"integrations",
# From sentry_sdk.api
"init",
Expand Down Expand Up @@ -47,6 +48,7 @@
"trace",
"monitor",
"logger",
"profiler",
"start_session",
"end_session",
"set_transaction_name",
Expand Down
Loading