File tree Expand file tree Collapse file tree 3 files changed +2
-58
lines changed Expand file tree Collapse file tree 3 files changed +2
-58
lines changed Original file line number Diff line number Diff line change 11import typing
22from typing import Optional
33
4- from .._synchronization import current_async_library
4+ from .._synchronization import current_async_backend
55from .base import SOCKET_OPTION , AsyncNetworkBackend , AsyncNetworkStream
66
77
88class AutoBackend (AsyncNetworkBackend ):
99 async def _init_backend (self ) -> None :
1010 if not (hasattr (self , "_backend" )):
11- backend = current_async_library ()
11+ backend = current_async_backend ()
1212 if backend == "trio" :
1313 from .trio import TrioBackend
1414
Original file line number Diff line number Diff line change 11import asyncio
2- import os
32import threading
43from types import TracebackType
54from typing import (
3130
3231
3332AsyncBackend = Literal ["asyncio" , "trio" ]
34- AsyncLibrary = Literal ["asyncio" , "trio" , "anyio" ]
3533
3634
3735def current_async_backend () -> AsyncBackend :
@@ -55,18 +53,6 @@ def current_async_backend() -> AsyncBackend:
5553 return environment
5654
5755
58- def current_async_library () -> AsyncLibrary :
59- if current_async_backend () == "trio" :
60- return "trio"
61-
62- if anyio is not None :
63- anyio_env = os .environ .get ("HTTPCORE_PREFER_ANYIO" , "true" ).lower ()
64- if anyio_env in ("true" , "1" ):
65- return "anyio"
66-
67- return "asyncio"
68-
69-
7056class _LockProto (Protocol ):
7157 async def acquire (self ) -> Any : ...
7258 def release (self ) -> None : ...
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments