mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
asyncio: Use socket specs for getaddrinfo() in sock_connect()
Patch by Martin Richard. GH PR #365.
This commit is contained in:
parent
77bc04a3bc
commit
63bf487688
2 changed files with 13 additions and 1 deletions
|
@ -394,7 +394,8 @@ class BaseSelectorEventLoop(base_events.BaseEventLoop):
|
|||
if hasattr(socket, 'AF_UNIX') and sock.family == socket.AF_UNIX:
|
||||
self._sock_connect(fut, sock, address)
|
||||
else:
|
||||
resolved = base_events._ensure_resolved(address, loop=self)
|
||||
resolved = base_events._ensure_resolved(
|
||||
address, family=sock.family, proto=sock.proto, loop=self)
|
||||
resolved.add_done_callback(
|
||||
lambda resolved: self._on_resolved(fut, sock, resolved))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue