Skip to content

Commit d305816

Browse files
committed
respect explicit flowinfo and scope in sock_connect
1 parent 9120c95 commit d305816

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

Lib/asyncio/base_events.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,9 +1341,17 @@ async def create_datagram_endpoint(self, protocol_factory,
13411341
async def _ensure_resolved(self, address, *,
13421342
family=0, type=socket.SOCK_STREAM,
13431343
proto=0, flags=0, loop):
1344-
host, port = address[:2]
1345-
return await loop.getaddrinfo(host, port, family=family, type=type,
1346-
proto=proto, flags=flags)
1344+
host, port, *rest = address
1345+
if not rest:
1346+
return await loop.getaddrinfo(
1347+
host, port, family=family, type=type, proto=proto, flags=flags,
1348+
)
1349+
return [
1350+
(*first, (host, port, *rest)) for *first, (host, port, *_) in
1351+
await loop.getaddrinfo(
1352+
host, port, family=family, type=type, proto=proto, flags=flags,
1353+
)
1354+
]
13471355

13481356
async def _create_server_getaddrinfo(self, host, port, family, flags):
13491357
infos = await self._ensure_resolved((host, port), family=family,

0 commit comments

Comments
 (0)