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.
This commit is contained in:
gandalf3
2023-01-21 13:00:44 -08:00
committed by GitHub
parent a8e4b3a018
commit b11e2e37c6
2 changed files with 6 additions and 6 deletions

View File

@@ -342,8 +342,8 @@ class BaseEventLoop(AbstractEventLoop):
async def create_datagram_endpoint( # type: ignore[override]
self,
protocol_factory: Callable[[], _ProtocolT],
local_addr: tuple[str, int] | None = None,
remote_addr: tuple[str, int] | None = None,
local_addr: tuple[str, int] | str | None = None,
remote_addr: tuple[str, int] | str | None = None,
*,
family: int = 0,
proto: int = 0,
@@ -356,8 +356,8 @@ class BaseEventLoop(AbstractEventLoop):
async def create_datagram_endpoint(
self,
protocol_factory: Callable[[], _ProtocolT],
local_addr: tuple[str, int] | None = ...,
remote_addr: tuple[str, int] | None = ...,
local_addr: tuple[str, int] | str | None = ...,
remote_addr: tuple[str, int] | str | None = ...,
*,
family: int = ...,
proto: int = ...,

View File

@@ -495,8 +495,8 @@ class AbstractEventLoop:
async def create_datagram_endpoint(
self,
protocol_factory: Callable[[], _ProtocolT],
local_addr: tuple[str, int] | None = None,
remote_addr: tuple[str, int] | None = None,
local_addr: tuple[str, int] | str | None = None,
remote_addr: tuple[str, int] | str | None = None,
*,
family: int = 0,
proto: int = 0,