Use assignment expressions 34 (#58823)

This commit is contained in:
Marc Mueller
2021-10-31 19:01:16 +01:00
committed by GitHub
parent e0c0d00833
commit 4c68662612
30 changed files with 36 additions and 75 deletions

View File

@@ -293,8 +293,7 @@ class FlowManager(abc.ABC):
@callback
def _async_remove_flow_progress(self, flow_id: str) -> None:
"""Remove a flow from in progress."""
flow = self._progress.pop(flow_id, None)
if flow is None:
if (flow := self._progress.pop(flow_id, None)) is None:
raise UnknownFlow
handler = flow.handler
self._handler_progress_index[handler].remove(flow.flow_id)