Skip to content
Closed
Changes from all 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
5 changes: 0 additions & 5 deletions sentry_sdk/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
from sentry_sdk import profiler
from sentry_sdk import metrics
from sentry_sdk.scope import Scope
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Removed submodule imports for profiler and metrics

Medium Severity

The explicit from sentry_sdk import profiler and from sentry_sdk import metrics imports were removed, but "profiler" and "metrics" remain in __all__. These submodules are not re-exported by sentry_sdk.api's __all__, so they won't be eagerly available as attributes of sentry_sdk after package initialization. Code relying on sentry_sdk.profiler or sentry_sdk.metrics without a direct import may break.

Fix in Cursor Fix in Web

from sentry_sdk.transport import Transport, HttpTransport
from sentry_sdk.client import Client
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Removed imports break public API exports in __all__

High Severity

The imports of Scope, Client, Transport, and HttpTransport were removed, but these names are still listed in __all__. Since from sentry_sdk.api import * only imports names from api.__all__ (which doesn't include these four), they no longer exist in the sentry_sdk namespace. This means from sentry_sdk import Scope will raise ImportError, sentry_sdk.Client will raise AttributeError, and from sentry_sdk import * will fail entirely.

Fix in Cursor Fix in Web


from sentry_sdk.api import * # noqa
from sentry_sdk.consts import VERSION
Expand Down
Loading