Use assignment expressions 39 (#58829)

This commit is contained in:
Marc Mueller
2021-10-31 18:56:25 +01:00
committed by GitHub
parent 72801867d6
commit e0c0d00833
23 changed files with 31 additions and 70 deletions

View File

@@ -52,9 +52,7 @@ async def async_detect_location_info(
session: aiohttp.ClientSession,
) -> LocationInfo | None:
"""Detect location information."""
data = await _get_whoami(session)
if data is None:
if (data := await _get_whoami(session)) is None:
return None
data["use_metric"] = data["country_code"] not in ("US", "MM", "LR")