Use assignment expressions 01 (#56394)

This commit is contained in:
Marc Mueller
2021-09-19 01:31:35 +02:00
committed by GitHub
parent a4f6c3336f
commit 7af67d34cf
21 changed files with 73 additions and 171 deletions

View File

@@ -93,9 +93,7 @@ class FlowManager(abc.ABC):
async def async_wait_init_flow_finish(self, handler: str) -> None:
"""Wait till all flows in progress are initialized."""
current = self._initializing.get(handler)
if not current:
if not (current := self._initializing.get(handler)):
return
await asyncio.wait(current)
@@ -189,9 +187,7 @@ class FlowManager(abc.ABC):
self, flow_id: str, user_input: dict | None = None
) -> FlowResult:
"""Continue a configuration flow."""
flow = self._progress.get(flow_id)
if flow is None:
if (flow := self._progress.get(flow_id)) is None:
raise UnknownFlow
cur_step = flow.cur_step