Skip to content

Commit cea78bc

Browse files
prevent circular imports
1 parent c07ac42 commit cea78bc

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

sentry_sdk/__init__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
from sentry_sdk import metrics, profiler
2-
from sentry_sdk.api import * # noqa
3-
from sentry_sdk.client import Client
2+
3+
from sentry_sdk.scope import Scope # isort: skip
4+
from sentry_sdk.client import Client # isort: skip
45
from sentry_sdk.consts import VERSION
5-
from sentry_sdk.scope import Scope
66
from sentry_sdk.transport import HttpTransport, Transport
77

8+
from sentry_sdk.api import * # noqa # isort: skip
9+
810
__all__ = [ # noqa
911
"Hub",
1012
"Scope",

sentry_sdk/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from contextlib import contextmanager
44
from typing import TYPE_CHECKING
55

6-
from sentry_sdk import Client, tracing_utils
6+
from sentry_sdk import tracing_utils, Client # isort: skip
77
from sentry_sdk._init_implementation import init
88
from sentry_sdk.consts import INSTRUMENTER
99
from sentry_sdk.crons import monitor

sentry_sdk/tracing_utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
import sentry_sdk
2323
from sentry_sdk.consts import OP, SPANDATA, SPANSTATUS, SPANTEMPLATE
24-
from sentry_sdk.tracing import Span as LegacySpan
2524
from sentry_sdk.utils import (
2625
_is_external_source,
2726
_is_in_project_root,
@@ -1722,7 +1721,9 @@ def _matches(rule: "Any", value: "Any") -> bool:
17221721
BAGGAGE_HEADER_NAME,
17231722
LOW_QUALITY_TRANSACTION_SOURCES,
17241723
SENTRY_TRACE_HEADER_NAME,
1725-
Span,
1724+
)
1725+
from sentry_sdk.tracing import (
1726+
Span as LegacySpan,
17261727
)
17271728

17281729
if TYPE_CHECKING:

0 commit comments

Comments
 (0)