@@ -581,7 +581,7 @@ class AsyncHttpTransport(HttpTransportCore):
581
581
def __init__ (self : Self , options : Dict [str , Any ]) -> None :
582
582
super ().__init__ (options )
583
583
# Requires event loop at init time
584
- self ._loop = asyncio .get_running_loop ()
584
+ self .loop = asyncio .get_running_loop ()
585
585
self .background_tasks : set [asyncio .Task [None ]] = set ()
586
586
587
587
def _get_header_value (self : Self , response : Any , header : str ) -> Optional [str ]:
@@ -679,10 +679,10 @@ def capture_envelope(self: Self, envelope: Envelope) -> None:
679
679
except RuntimeError :
680
680
# We are in a background thread, not running an event loop,
681
681
# 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 ():
683
683
asyncio .run_coroutine_threadsafe (
684
684
self ._capture_envelope (envelope ),
685
- self ._loop ,
685
+ self .loop ,
686
686
)
687
687
else :
688
688
# The event loop is no longer running
@@ -793,7 +793,7 @@ def kill(self: Self) -> Optional[asyncio.Task[None]]: # type: ignore
793
793
self .background_tasks .clear ()
794
794
try :
795
795
# 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
797
797
except RuntimeError :
798
798
logger .warning ("Event loop not running, aborting kill." )
799
799
return None
0 commit comments