Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions python/rsloop/_loop_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,11 +567,15 @@ async def __loop_create_datagram_endpoint(
raise ValueError(
"socket modifier keyword arguments can not be used when sock is specified"
)
if sock is None and local_addr is None and remote_addr is None:
if (
sock is None
and local_addr is None
and remote_addr is None
and family == 0
):
raise ValueError("unexpected address family")

if sock is None:
addrinfos = None
if remote_addr is not None:
addrinfos = await self.getaddrinfo(
*remote_addr,
Expand All @@ -588,6 +592,10 @@ async def __loop_create_datagram_endpoint(
proto=proto,
flags=flags,
)
else:
addrinfos = [
(family, __socket.SOCK_DGRAM, proto, "", None),
]
if not addrinfos:
raise OSError("getaddrinfo() returned empty list")

Expand Down
Loading