Skip to content

Commit 8669305

Browse files
committed
Fix SequentialCommandGroup.end logic to match Java
- self._currentCommandIndex must always be set to -1 in end
1 parent 5e39de9 commit 8669305

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

commands2/sequentialcommandgroup.py

+6-9
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,13 @@ def execute(self):
6666
self._commands[self._currentCommandIndex].initialize()
6767

6868
def end(self, interrupted: bool):
69-
if not interrupted:
70-
return
71-
if not self._commands:
72-
return
73-
if not self._currentCommandIndex > -1:
74-
return
75-
if not self._currentCommandIndex < len(self._commands):
76-
return
69+
if (
70+
interrupted
71+
and self._commands
72+
and -1 < self._currentCommandIndex < len(self._commands)
73+
):
74+
self._commands[self._currentCommandIndex].end(True)
7775

78-
self._commands[self._currentCommandIndex].end(True)
7976
self._currentCommandIndex = -1
8077

8178
def isFinished(self) -> bool:

0 commit comments

Comments
 (0)