diff --git a/launch_testing/launch_testing/legacy/__init__.py b/launch_testing/launch_testing/legacy/__init__.py index bfe094a86..ccc3ebb2d 100644 --- a/launch_testing/launch_testing/legacy/__init__.py +++ b/launch_testing/launch_testing/legacy/__init__.py @@ -195,7 +195,6 @@ def add_output_test( assert any(match_patterns) def on_process_exit(event, context): - nonlocal match_patterns if any(match_patterns): # Finish test instead of failing to prevent process exit # and process output event handlers from racing. @@ -208,7 +207,6 @@ def on_process_exit(event, context): ) def on_shutdown(event, context): - nonlocal match_patterns if any(match_patterns): process_name = action.process_details['name'] reason = 'not all {} output matched!'.format(process_name)