Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is_running() works incorrectly, if execution fails with an exception #47

Open
okalachev opened this issue Apr 9, 2017 · 0 comments
Open

Comments

@okalachev
Copy link

okalachev commented Apr 9, 2017

If state machine's state fails with an exception, _is_running flag is not lowered, although the state machine obviously is not running.

Example code:

from smach import StateMachine, State

class FailingState(State):
    def execute(self, ud):
        0/0  # exception

s = StateMachine(outcomes=[])
with s:
    StateMachine.add('foo', FailingState())

try:
    s.execute()
except:
    pass

print 'running', s.is_running()

Output:

<...>
ZeroDivisionError: integer division or modulo by zero
<...>
running True

Isn't is an issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant