75
75
_client_init_debug = ContextVar ("client_init_debug" )
76
76
77
77
78
- SDK_INFO : " SDKInfo" = {
78
+ SDK_INFO : SDKInfo = {
79
79
"name" : "sentry.python" , # SDK name will be overridden after integrations have been loaded with sentry_sdk.integrations.setup_integrations()
80
80
"version" : VERSION ,
81
81
"packages" : [{"name" : "pypi:sentry-sdk" , "version" : VERSION }],
@@ -464,7 +464,7 @@ def _prepare_event(
464
464
)
465
465
return None
466
466
467
- event = event_ # Updated event from scope
467
+ event = event_
468
468
spans_delta = spans_before - len (
469
469
cast ("List[Dict[str, object]]" , event .get ("spans" , []))
470
470
)
@@ -578,7 +578,7 @@ def _prepare_event(
578
578
if event .get ("exception" ):
579
579
DedupeIntegration .reset_last_seen ()
580
580
581
- event = new_event # Updated event from before_send
581
+ event = new_event
582
582
583
583
before_send_transaction = self .options ["before_send_transaction" ]
584
584
if (
@@ -610,7 +610,7 @@ def _prepare_event(
610
610
reason = "before_send" , data_category = "span" , quantity = spans_delta
611
611
)
612
612
613
- event = new_event # Updated event from before_send_transaction
613
+ event = new_event
614
614
615
615
return event
616
616
@@ -757,17 +757,17 @@ def capture_event(
757
757
758
758
:returns: An event ID. May be `None` if there is no DSN set or of if the SDK decided to discard the event for other reasons. In such situations setting `debug=True` on `init()` may help.
759
759
"""
760
- hint_dict : Hint = dict (hint or ())
760
+ hint : Hint = dict (hint or ())
761
761
762
- if not self ._should_capture (event , hint_dict , scope ):
762
+ if not self ._should_capture (event , hint , scope ):
763
763
return None
764
764
765
765
profile = event .pop ("profile" , None )
766
766
767
767
event_id = event .get ("event_id" )
768
768
if event_id is None :
769
769
event ["event_id" ] = event_id = uuid .uuid4 ().hex
770
- event_opt = self ._prepare_event (event , hint_dict , scope )
770
+ event_opt = self ._prepare_event (event , hint , scope )
771
771
if event_opt is None :
772
772
return None
773
773
@@ -783,11 +783,11 @@ def capture_event(
783
783
if (
784
784
not is_transaction
785
785
and not is_checkin
786
- and not self ._should_sample_error (event , hint_dict )
786
+ and not self ._should_sample_error (event , hint )
787
787
):
788
788
return None
789
789
790
- attachments = hint_dict .get ("attachments" )
790
+ attachments = hint .get ("attachments" )
791
791
792
792
trace_context = event_opt .get ("contexts" , {}).get ("trace" ) or {}
793
793
dynamic_sampling_context = trace_context .pop ("dynamic_sampling_context" , {})
0 commit comments