Skip to content
This repository was archived by the owner on Nov 23, 2017. It is now read-only.

Commit 7db527f

Browse files
committed
Be extra careful
1 parent b6d8612 commit 7db527f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

asyncio/selector_events.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ def _test_selector_event(selector, fd, event):
4242
if hasattr(socket, 'TCP_NODELAY'):
4343
def _set_nodelay(sock):
4444
if (sock.family in {socket.AF_INET, socket.AF_INET6} and
45-
sock.type == socket.SOCK_STREAM):
45+
sock.type == socket.SOCK_STREAM and
46+
sock.proto == socket.IPPROTO_TCP):
4647
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
4748
else:
4849
def _set_nodelay(sock):

0 commit comments

Comments
 (0)