summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/selector_events.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-03-28 22:16:30 (GMT)
committerGitHub <noreply@github.com>2022-03-28 22:16:30 (GMT)
commitf84fb55659079bbc99d4cd0441dc13ab07ac3dcf (patch)
tree4c3b5b1fe628c2c144862f3944a4de70b35725ac /Lib/asyncio/selector_events.py
parentdae09c2b819c2683ad870733451c050b59c3eb93 (diff)
downloadcpython-f84fb55659079bbc99d4cd0441dc13ab07ac3dcf.zip
cpython-f84fb55659079bbc99d4cd0441dc13ab07ac3dcf.tar.gz
cpython-f84fb55659079bbc99d4cd0441dc13ab07ac3dcf.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> (cherry picked from commit 5c30388f3c586ba2f33e349e22e5949cb92de621) Co-authored-by: Vincent Bernat <vincent@bernat.ch>
Diffstat (limited to 'Lib/asyncio/selector_events.py')
-rw-r--r--Lib/asyncio/selector_events.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/asyncio/selector_events.py b/Lib/asyncio/selector_events.py
index 71080b8ad..572d4a8 100644
--- a/Lib/asyncio/selector_events.py
+++ b/Lib/asyncio/selector_events.py
@@ -487,7 +487,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,