diff --git a/launch_testing_ros/test/examples/wait_for_topic_inject_callback_test.py b/launch_testing_ros/test/examples/wait_for_topic_inject_callback_test.py index 4d4bc278..719d0b1d 100644 --- a/launch_testing_ros/test/examples/wait_for_topic_inject_callback_test.py +++ b/launch_testing_ros/test/examples/wait_for_topic_inject_callback_test.py @@ -41,7 +41,7 @@ def generate_node(): def trigger_callback(): command = 'ros2 topic pub --once --max-wait-time-secs 10 --keep-alive 1 \ /input std_msgs/msg/String "data: Hello World"' - p = Popen(command, shell=True, stdout=PIPE, stderr=PIPE) + p = Popen(command.split(), stdout=PIPE, stderr=PIPE) stdout, stderr = p.communicate() print("stdout: ", stdout) print("stderr: ", stderr)