@@ -581,7 +581,7 @@ class AsyncHttpTransport(HttpTransportCore):
581581 def __init__ (self : Self , options : Dict [str , Any ]) -> None :
582582 super ().__init__ (options )
583583 # Requires event loop at init time
584- self ._loop = asyncio .get_running_loop ()
584+ self .loop = asyncio .get_running_loop ()
585585 self .background_tasks : set [asyncio .Task [None ]] = set ()
586586
587587 def _get_header_value (self : Self , response : Any , header : str ) -> Optional [str ]:
@@ -679,10 +679,10 @@ def capture_envelope(self: Self, envelope: Envelope) -> None:
679679 except RuntimeError :
680680 # We are in a background thread, not running an event loop,
681681 # have to launch the task on the loop in a threadsafe way.
682- if self ._loop and self ._loop .is_running ():
682+ if self .loop and self .loop .is_running ():
683683 asyncio .run_coroutine_threadsafe (
684684 self ._capture_envelope (envelope ),
685- self ._loop ,
685+ self .loop ,
686686 )
687687 else :
688688 # The event loop is no longer running
@@ -793,7 +793,7 @@ def kill(self: Self) -> Optional[asyncio.Task[None]]: # type: ignore
793793 self .background_tasks .clear ()
794794 try :
795795 # Return the pool cleanup task so caller can await it if needed
796- return self ._loop .create_task (self ._pool .aclose ()) # type: ignore
796+ return self .loop .create_task (self ._pool .aclose ()) # type: ignore
797797 except RuntimeError :
798798 logger .warning ("Event loop not running, aborting kill." )
799799 return None
0 commit comments