summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/unix_events.py
diff options
context:
space:
mode:
authorYury Selivanov <yury@magic.io>2016-11-09 20:47:00 (GMT)
committerYury Selivanov <yury@magic.io>2016-11-09 20:47:00 (GMT)
commita1a8b7d3d7f628aec31be364c77cbb3e21cdbc0b (patch)
treef1c1fa5ae61d965d131a437904bd1712c7a6f017 /Lib/asyncio/unix_events.py
parentd2fd3599abeed393ccdf4ee5cf1c7b346ba4a022 (diff)
downloadcpython-a1a8b7d3d7f628aec31be364c77cbb3e21cdbc0b.zip
cpython-a1a8b7d3d7f628aec31be364c77cbb3e21cdbc0b.tar.gz
cpython-a1a8b7d3d7f628aec31be364c77cbb3e21cdbc0b.tar.bz2
Issue #28652: Make loop methods reject socket kinds they do not support.
Diffstat (limited to 'Lib/asyncio/unix_events.py')
-rw-r--r--Lib/asyncio/unix_events.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/asyncio/unix_events.py b/Lib/asyncio/unix_events.py
index 65b61db..788a5a0 100644
--- a/Lib/asyncio/unix_events.py
+++ b/Lib/asyncio/unix_events.py
@@ -235,7 +235,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
- sock.type != socket.SOCK_STREAM):
+ not base_events._is_stream_socket(sock)):
raise ValueError(
'A UNIX Domain Stream Socket was expected, got {!r}'
.format(sock))
@@ -289,7 +289,7 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop):
'path was not specified, and no sock specified')
if (sock.family != socket.AF_UNIX or
- sock.type != socket.SOCK_STREAM):
+ not base_events._is_stream_socket(sock)):
raise ValueError(
'A UNIX Domain Stream Socket was expected, got {!r}'
.format(sock))