Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions httpcore/_synchronization.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,17 @@
except ImportError: # pragma: nocover
anyio = None # type: ignore

try:
import sniffio
except ImportError: # pragma: nocover
sniffio = None # type: ignore


def current_async_library() -> str:
# Determine if we're running under trio or asyncio.
# See https://sniffio.readthedocs.io/en/latest/
try:
import sniffio
except ImportError: # pragma: nocover
environment = "asyncio"
if sniffio is None:
environment = "asyncio" # pragma: nocover
else:
environment = sniffio.current_async_library()

Expand Down
Loading