diff options
author | Quentin Dawans <github@ovv.wtf> | 2017-10-30 14:43:02 +0100 |
---|---|---|
committer | Yury Selivanov <yury@magic.io> | 2017-10-30 09:43:02 -0400 |
commit | fe4ea9cf1ee04f5a60e4ed928d8624b95b031e18 (patch) | |
tree | a783b709a8856fdf34d540108e78803e6114c84b /Lib/asyncio/base_events.py | |
parent | a2314283ff87c65e1745a42c2f2b716b1a209128 (diff) | |
download | cpython-git-fe4ea9cf1ee04f5a60e4ed928d8624b95b031e18.tar.gz |
bpo-31245: Asyncio unix socket datagram (#3164)
Diffstat (limited to 'Lib/asyncio/base_events.py')
-rw-r--r-- | Lib/asyncio/base_events.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py index 33b8f4887c..2a5a4f9895 100644 --- a/Lib/asyncio/base_events.py +++ b/Lib/asyncio/base_events.py @@ -859,6 +859,12 @@ class BaseEventLoop(events.AbstractEventLoop): if family == 0: raise ValueError('unexpected address family') addr_pairs_info = (((family, proto), (None, None)),) + elif hasattr(socket, 'AF_UNIX') and family == socket.AF_UNIX: + for addr in (local_addr, remote_addr): + if addr is not None and not isistance(addr, str): + raise TypeError('string is expected') + addr_pairs_info = (((family, proto), + (local_addr, remote_addr)), ) else: # join address by (family, protocol) addr_infos = collections.OrderedDict() |