From 1a3218382261dacadcfd4b5f49b7fb76efbe35b7 Mon Sep 17 00:00:00 2001 From: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com> Date: Fri, 10 May 2024 16:08:41 +0200 Subject: [PATCH] ref(scope): Fix `get_client` typing (#3063) 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. --- sentry_sdk/scope.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sentry_sdk/scope.py b/sentry_sdk/scope.py index 9cae308e5c..e55b4ea3c7 100644 --- a/sentry_sdk/scope.py +++ b/sentry_sdk/scope.py @@ -1640,3 +1640,6 @@ def should_send_default_pii(): # Circular imports from sentry_sdk.client import NonRecordingClient + +if TYPE_CHECKING: + import sentry_sdk.client