Exit transition immediately if already in the desired state.
This commit is contained in:
parent
4e12e228cb
commit
d11a67702e
1 changed files with 8 additions and 5 deletions
3
sleekxmpp/thirdparty/statemachine.py
vendored
3
sleekxmpp/thirdparty/statemachine.py
vendored
|
@ -90,6 +90,9 @@ class StateMachine(object):
|
|||
log.debug("Could not acquire lock")
|
||||
return False
|
||||
|
||||
if self.__current_state == to_state:
|
||||
return True
|
||||
|
||||
while not self.__current_state in from_states:
|
||||
# detect timeout:
|
||||
remainder = start + wait - time.time()
|
||||
|
|
Loading…
Reference in a new issue