Skip to content

Commit b91a526

Browse files
author
fkromer
committed
change: EAFP refactoring of HierarchicalStateMachine._next_state()
1 parent 4ec0f17 commit b91a526

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎hsm.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ def __init__(self):
4040
'operator inservice': self._current_state.on_operator_inservice}
4141

4242
def_next_state(self, state):
43-
ifstateinself.states.keys():
43+
try:
4444
self._current_state=self.states[state]
45-
else:
45+
exceptKeyError:
4646
raiseUnsupportedState
4747

4848
def_send_diagnostics_request(self):

0 commit comments

Comments
(0)