Enable Ruff RUF013 (#115333)

This commit is contained in:
Sid 2024-04-10 08:55:59 +02:00 committed by GitHub
parent 7e1a5b19c4
commit 3efee10b95
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 65 additions and 58 deletions

View file

@ -189,7 +189,9 @@ class Client:
self.client = client
self.id = 0
async def cmd(self, cmd: str, payload: dict[str, Any] = None) -> dict[str, Any]:
async def cmd(
self, cmd: str, payload: dict[str, Any] | None = None
) -> dict[str, Any]:
"""Send a command and receive the json result."""
self.id += 1
await self.client.send_json(
@ -203,7 +205,7 @@ class Client:
assert resp.get("id") == self.id
return resp
async def cmd_result(self, cmd: str, payload: dict[str, Any] = None) -> Any:
async def cmd_result(self, cmd: str, payload: dict[str, Any] | None = None) -> Any:
"""Send a command and parse the result."""
resp = await self.cmd(cmd, payload)
assert resp.get("success")