We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e4c8eb2 commit d3bb19bCopy full SHA for d3bb19b
src/trio/socket.py
@@ -70,10 +70,16 @@
70
if sys.implementation.name == "cpython":
71
from socket import (
72
if_indextoname as if_indextoname,
73
- if_nameindex as if_nameindex,
74
if_nametoindex as if_nametoindex,
75
)
76
+ # For android devices, if_nameindex support was introduced in API 24,
77
+ # so it doesn't exist for any version prior.
78
+ with _suppress(ImportError):
79
+ from socket import (
80
+ if_nameindex as if_nameindex,
81
+ )
82
+
83
84
# not always available so expose only if
85
if sys.platform != "win32" or not _t.TYPE_CHECKING:
0 commit comments