diff options
author | Yury Selivanov <yury@magic.io> | 2017-12-19 11:44:37 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-19 11:44:37 (GMT) |
commit | a7bd64c0c01379e9b82e86ad41a301329a0775d9 (patch) | |
tree | 142cbba8e3f45cc386120bc92d5241a141f7aaf7 /Lib/asyncio/selector_events.py | |
parent | 5d8624647d0b8ccb22b17b9e819a8e0c3fb4fe4a (diff) | |
download | cpython-a7bd64c0c01379e9b82e86ad41a301329a0775d9.zip cpython-a7bd64c0c01379e9b82e86ad41a301329a0775d9.tar.gz cpython-a7bd64c0c01379e9b82e86ad41a301329a0775d9.tar.bz2 |
bpo-27456: Simplify sock type checks (#4922)
Recent sock.type fix (see bug 32331) makes sock.type checks simpler
in asyncio.
Diffstat (limited to 'Lib/asyncio/selector_events.py')
-rw-r--r-- | Lib/asyncio/selector_events.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/asyncio/selector_events.py b/Lib/asyncio/selector_events.py index 3f44a99..3b49b0c 100644 --- a/Lib/asyncio/selector_events.py +++ b/Lib/asyncio/selector_events.py @@ -41,7 +41,7 @@ def _test_selector_event(selector, fd, event): if hasattr(socket, 'TCP_NODELAY'): def _set_nodelay(sock): if (sock.family in {socket.AF_INET, socket.AF_INET6} and - base_events._is_stream_socket(sock.type) and + sock.type == socket.SOCK_STREAM and sock.proto == socket.IPPROTO_TCP): sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) else: |