Skip to content

Commit 4f3030f

Browse files
committed
Assume SO_PROTOCOL and SO_DOMAIN exist on Linux
Since we no longer support Python 3.5.
1 parent 60b812a commit 4f3030f

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

trio/_socket.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -295,13 +295,7 @@ def _sniff_sockopts_for_fileno(family, type, proto, fileno):
295295
# and then we'll throw it away and construct a new one with the correct metadata.
296296
if not _sys.platform == "linux":
297297
return family, type, proto
298-
try:
299-
from socket import SO_DOMAIN, SO_PROTOCOL
300-
except ImportError:
301-
# Only available on 3.6 and above:
302-
SO_PROTOCOL = 38
303-
SO_DOMAIN = 39
304-
from socket import SOL_SOCKET, SO_TYPE
298+
from socket import SO_DOMAIN, SO_PROTOCOL, SOL_SOCKET, SO_TYPE
305299
sockobj = _stdlib_socket.socket(family, type, proto, fileno=fileno)
306300
try:
307301
family = sockobj.getsockopt(SOL_SOCKET, SO_DOMAIN)

0 commit comments

Comments
 (0)