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(
959
959
await self ._close_components_async ()
960
960
961
961
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
+ ):
963
965
964
966
try :
965
967
flush_task = self .transport .loop .create_task (
@@ -996,7 +998,9 @@ def flush( # type: ignore[override]
996
998
if timeout is None :
997
999
timeout = self .options ["shutdown_timeout" ]
998
1000
999
- if isinstance (self .transport , AsyncHttpTransport ):
1001
+ if isinstance (self .transport , AsyncHttpTransport ) and hasattr (
1002
+ self .transport , "loop"
1003
+ ):
1000
1004
try :
1001
1005
return self .transport .loop .create_task (
1002
1006
self ._flush_async (timeout , callback )
Original file line number Diff line number Diff line change 29
29
HTTP2_ENABLED = False
30
30
31
31
try :
32
+ import anyio # noqa: F401
33
+
32
34
ASYNC_TRANSPORT_ENABLED = httpcore is not None
33
35
except ImportError :
34
36
ASYNC_TRANSPORT_ENABLED = False
You can’t perform that action at this time.
0 commit comments