From 4a01c21aa55fbffced538c86555a2108d3216643 Mon Sep 17 00:00:00 2001 From: Daniel Szoke Date: Fri, 10 May 2024 15:55:26 +0200 Subject: [PATCH] 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. --- 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