Exit transition immediately if already in the desired state.
This commit is contained in:
parent
4e12e228cb
commit
d11a67702e
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")
|
log.debug("Could not acquire lock")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
if self.__current_state == to_state:
|
||||||
|
return True
|
||||||
|
|
||||||
while not self.__current_state in from_states:
|
while not self.__current_state in from_states:
|
||||||
# detect timeout:
|
# detect timeout:
|
||||||
remainder = start + wait - time.time()
|
remainder = start + wait - time.time()
|
||||||
|
Loading…
Reference in New Issue
Block a user