Skip to content

Commit bbe01a5

Browse files
ref(scope): Fix get_client typing
The `Scope.get_client` method is typed as returning `sentry_sdk.client.BaseClient`, but because `sentry_sdk.client` was not imported, the type was resolved as `Any`. This change imports `sentry_sdk.client` to fix the type hints.
1 parent 2cdc635 commit bbe01a5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

sentry_sdk/scope.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ class Scope(object):
185185
"_propagation_context",
186186
"client",
187187
"_type",
188+
"_last_event_id",
188189
)
189190

190191
def __init__(self, ty=None, client=None):
@@ -207,6 +208,9 @@ def __init__(self, ty=None, client=None):
207208
incoming_trace_information = self._load_trace_data_from_env()
208209
self.generate_propagation_context(incoming_data=incoming_trace_information)
209210

211+
# self._last_event_id is only applicable to isolation scopes
212+
self._last_event_id = None # type: Optional[str]
213+
210214
def __copy__(self):
211215
# type: () -> Scope
212216
"""
@@ -1640,3 +1644,6 @@ def should_send_default_pii():
16401644

16411645
# Circular imports
16421646
from sentry_sdk.client import NonRecordingClient
1647+
1648+
if TYPE_CHECKING:
1649+
import sentry_sdk.client

0 commit comments

Comments
 (0)