@@ -163,7 +163,7 @@ def _parse_rate_limits(
163163
164164
165165class HttpTransportCore (Transport ):
166- """The base HTTP transport ."""
166+ """Shared base class for sync and async transports ."""
167167
168168 TIMEOUT = 30 # seconds
169169
@@ -392,6 +392,8 @@ def is_healthy(self: Self) -> bool:
392392 def _prepare_envelope (
393393 self : Self , envelope : Envelope
394394 ) -> Optional [Tuple [Envelope , io .BytesIO , Dict [str , str ]]]:
395+
396+ # remove all items from the envelope which are over quota
395397 new_items = []
396398 for item in envelope .items :
397399 if self ._check_disabled (item .data_category ):
@@ -500,18 +502,18 @@ def kill(self: Self) -> None:
500502
501503
502504class BaseHttpTransport (HttpTransportCore ):
505+ """The base HTTP transport."""
503506
504507 def _send_envelope (self : Self , envelope : Envelope ) -> None :
505508 _prepared_envelope = self ._prepare_envelope (envelope )
506- if _prepared_envelope is None :
507- return None
508- envelope , body , headers = _prepared_envelope
509- self ._send_request (
510- body .getvalue (),
511- headers = headers ,
512- endpoint_type = EndpointType .ENVELOPE ,
513- envelope = envelope ,
514- )
509+ if _prepared_envelope is not None :
510+ envelope , body , headers = _prepared_envelope
511+ self ._send_request (
512+ body .getvalue (),
513+ headers = headers ,
514+ endpoint_type = EndpointType .ENVELOPE ,
515+ envelope = envelope ,
516+ )
515517 return None
516518
517519 def _send_request (
0 commit comments