diff options
author | Vincent Bernat <vincent@bernat.ch> | 2022-03-28 21:50:26 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-28 21:50:26 (GMT) |
commit | 5c30388f3c586ba2f33e349e22e5949cb92de621 (patch) | |
tree | 30da9205341b0550b11ac4ecd22243b0ab10a522 /Lib/asyncio | |
parent | 7b44ade018cfe6f54002a3cee43e8aa415d4d635 (diff) | |
download | cpython-5c30388f3c586ba2f33e349e22e5949cb92de621.zip cpython-5c30388f3c586ba2f33e349e22e5949cb92de621.tar.gz cpython-5c30388f3c586ba2f33e349e22e5949cb92de621.tar.bz2 |
bpo-27929: resolve names only for AF_INET/AF_INET6 with asyncio (GH-32131)
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
Diffstat (limited to 'Lib/asyncio')
-rw-r--r-- | Lib/asyncio/selector_events.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/asyncio/selector_events.py b/Lib/asyncio/selector_events.py index 33ebc4b..e99a503 100644 --- a/Lib/asyncio/selector_events.py +++ b/Lib/asyncio/selector_events.py @@ -620,7 +620,8 @@ class BaseSelectorEventLoop(base_events.BaseEventLoop): if self._debug and sock.gettimeout() != 0: raise ValueError("the socket must be non-blocking") - if not hasattr(socket, 'AF_UNIX') or sock.family != socket.AF_UNIX: + if sock.family == socket.AF_INET or ( + base_events._HAS_IPv6 and sock.family == socket.AF_INET6): resolved = await self._ensure_resolved( address, family=sock.family, type=sock.type, proto=sock.proto, loop=self, |