Skip to content

Commit b11e2e3

Browse files
author
gandalf3
authored
create_datagram_endpoint expects a str when family=AF_UNIX (#9574)
Since python 3.7, asyncio.loop.create_datagram_endpoint expects the arguments `local_addr` and `remote_addr` to be `str` or `None` when the argument family=`socket.AF_UNIX` and the argument `sock` is `None` or also a unix socket.
1 parent a8e4b3a commit b11e2e3

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

stdlib/asyncio/base_events.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,8 @@ class BaseEventLoop(AbstractEventLoop):
342342
async def create_datagram_endpoint( # type: ignore[override]
343343
self,
344344
protocol_factory: Callable[[], _ProtocolT],
345-
local_addr: tuple[str, int] | None = None,
346-
remote_addr: tuple[str, int] | None = None,
345+
local_addr: tuple[str, int] | str | None = None,
346+
remote_addr: tuple[str, int] | str | None = None,
347347
*,
348348
family: int = 0,
349349
proto: int = 0,
@@ -356,8 +356,8 @@ class BaseEventLoop(AbstractEventLoop):
356356
async def create_datagram_endpoint(
357357
self,
358358
protocol_factory: Callable[[], _ProtocolT],
359-
local_addr: tuple[str, int] | None = ...,
360-
remote_addr: tuple[str, int] | None = ...,
359+
local_addr: tuple[str, int] | str | None = ...,
360+
remote_addr: tuple[str, int] | str | None = ...,
361361
*,
362362
family: int = ...,
363363
proto: int = ...,

stdlib/asyncio/events.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,8 +495,8 @@ class AbstractEventLoop:
495495
async def create_datagram_endpoint(
496496
self,
497497
protocol_factory: Callable[[], _ProtocolT],
498-
local_addr: tuple[str, int] | None = None,
499-
remote_addr: tuple[str, int] | None = None,
498+
local_addr: tuple[str, int] | str | None = None,
499+
remote_addr: tuple[str, int] | str | None = None,
500500
*,
501501
family: int = 0,
502502
proto: int = 0,

0 commit comments

Comments
 (0)