Skip to content
Merged
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
9 changes: 6 additions & 3 deletions src/httpcore2/httpcore2/_synchronization.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@
except ImportError: # pragma: no cover
anyio = None # type: ignore

try:
import sniffio
except ImportError: # pragma: no cover
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: no cover
if sniffio is None: # pragma: no cover
environment = "asyncio"
else:
environment = sniffio.current_async_library()
Expand Down
Loading