ros2 / rclpy

rclpy (ROS Client Library for Python)
Apache License 2.0
268 stars 221 forks source link

Add top-level try_shutdown method. #1302

Closed clalancette closed 1 week ago

clalancette commented 1 week ago

I noticed that this was needed when trying to convert some of the examples over to the context manager. They currently throw an exception because the signal handler does the shutdown, and then leaving the context tries to do it again.

This is also more symmetric with what shutdown() does, in that it also uninstalls signal handlers.

This is a follow-up to #1298

@sloretz FYI

clalancette commented 1 week ago

CI: