Skip to content

Commit

Permalink
autotest: copy message hooks while iterating over them for removal
Browse files Browse the repository at this point in the history
won't remove a number of entries from the end of the list if others have been removed
  • Loading branch information
peterbarker committed Jun 9, 2024
1 parent 2af6358 commit 2a964c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Tools/autotest/vehicle_test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -8456,7 +8456,7 @@ def run_one_test_attempt(self, test, interact=False, attempt=1, suppress_stdout=
ex = e
# reset the message hooks; we've failed-via-exception and
# can't expect the hooks to have been cleaned up
for h in self.mav.message_hooks:
for h in copy.copy(self.mav.message_hooks):
if h not in start_message_hooks:
self.mav.message_hooks.remove(h)
hooks_removed = True
Expand Down

0 comments on commit 2a964c4

Please sign in to comment.