File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -959,7 +959,9 @@ async def _flush_and_close(
959959 await self ._close_components_async ()
960960
961961 if self .transport is not None :
962- if isinstance (self .transport , AsyncHttpTransport ):
962+ if isinstance (self .transport , AsyncHttpTransport ) and hasattr (
963+ self .transport , "loop"
964+ ):
963965
964966 try :
965967 flush_task = self .transport .loop .create_task (
@@ -996,7 +998,9 @@ def flush( # type: ignore[override]
996998 if timeout is None :
997999 timeout = self .options ["shutdown_timeout" ]
9981000
999- if isinstance (self .transport , AsyncHttpTransport ):
1001+ if isinstance (self .transport , AsyncHttpTransport ) and hasattr (
1002+ self .transport , "loop"
1003+ ):
10001004 try :
10011005 return self .transport .loop .create_task (
10021006 self ._flush_async (timeout , callback )
Original file line number Diff line number Diff line change 2929 HTTP2_ENABLED = False
3030
3131try :
32+ import anyio # noqa: F401
33+
3234 ASYNC_TRANSPORT_ENABLED = httpcore is not None
3335except ImportError :
3436 ASYNC_TRANSPORT_ENABLED = False
You can’t perform that action at this time.
0 commit comments