chore(report): Use for/else clause (#24107)

This commit is contained in:
John Bodley
2023-05-19 06:41:17 -07:00
committed by GitHub
parent ba0bb20be5
commit 488ec02e70

View File

@@ -670,7 +670,6 @@ class ReportScheduleStateMachine: # pylint: disable=too-few-public-methods
self._scheduled_dttm = scheduled_dttm
def run(self) -> None:
state_found = False
for state_cls in self.states_cls:
if (self._report_schedule.last_state is None and state_cls.initial) or (
self._report_schedule.last_state in state_cls.current_states
@@ -681,9 +680,8 @@ class ReportScheduleStateMachine: # pylint: disable=too-few-public-methods
self._scheduled_dttm,
self._execution_id,
).next()
state_found = True
break
if not state_found:
else:
raise ReportScheduleStateNotFoundError()