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
8 changes: 7 additions & 1 deletion src/trio/socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,16 @@
if sys.implementation.name == "cpython":
from socket import (
if_indextoname as if_indextoname,
if_nameindex as if_nameindex,
if_nametoindex as if_nametoindex,
)

# For android devices, if_nameindex support was introduced in API 24,
# so it doesn't exist for any version prior.
with _suppress(ImportError):
from socket import (
if_nameindex as if_nameindex,
)


# not always available so expose only if
if sys.platform != "win32" or not _t.TYPE_CHECKING:
Expand Down