Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
My team noticed a new bug in Sequence execution when we were upgrading py_trees from a version pre-2.0.15 to the current one. I added what seems to be a sensible change and two tests which show how it was broken before.
I noticed that prior to this change, if, for example, you tried to execute a static sequence of two behaviours that both succeed, you'd execute the first behaviour, then set current_child to the second behaviour, then execute the first behaviour, and set current_child to the second behaviour, then you'd be done because the main itertools iteration over the list of children would be done. However, after the change, with the sequence of two behaviours, you execute the first behaviour, set current_child to the second behaviour, then execute the second behaviour, try to set current_child to be the third behaviour, then hit the IndexError and pass, and still realize you were done because your itertools iteration is up.