Use assignment expressions 05 (#57785)

This commit is contained in:
Marc Mueller 2021-10-17 19:56:00 +02:00 committed by GitHub
parent d09ee11c54
commit 5048bad050
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 36 additions and 71 deletions

View file

@ -8,9 +8,7 @@ from aiohttp import payload, web
def aiohttp_serialize_response(response: web.Response) -> dict[str, Any]:
"""Serialize an aiohttp response to a dictionary."""
body = response.body
if body is None:
if (body := response.body) is None:
pass
elif isinstance(body, payload.StringPayload):
# pylint: disable=protected-access