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/unix_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/unix_events.py')
-rw-r--r-- | Lib/asyncio/unix_events.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/asyncio/unix_events.py b/Lib/asyncio/unix_events.py index 50d78c8..2ab6b15 100644 --- a/Lib/asyncio/unix_events.py +++ b/Lib/asyncio/unix_events.py @@ -222,7 +222,7 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop): if sock is None: raise ValueError('no path and sock were specified') if (sock.family != socket.AF_UNIX or - not base_events._is_stream_socket(sock.type)): + sock.type != socket.SOCK_STREAM): raise ValueError( f'A UNIX Domain Stream Socket was expected, got {sock!r}') sock.setblocking(False) @@ -276,7 +276,7 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop): 'path was not specified, and no sock specified') if (sock.family != socket.AF_UNIX or - not base_events._is_stream_socket(sock.type)): + sock.type != socket.SOCK_STREAM): raise ValueError( f'A UNIX Domain Stream Socket was expected, got {sock!r}') |