From e6fe67aa7744a8b667c487df68b2faf227fe6e2d Mon Sep 17 00:00:00 2001 From: Shane Loretz Date: Tue, 14 Dec 2021 11:56:23 -0800 Subject: [PATCH] Shorten on_shutdown callback call Signed-off-by: Shane Loretz --- rclpy/rclpy/clock.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/rclpy/rclpy/clock.py b/rclpy/rclpy/clock.py index 45a63675a..38af785e3 100644 --- a/rclpy/rclpy/clock.py +++ b/rclpy/rclpy/clock.py @@ -216,11 +216,8 @@ def on_time_jump(time_jump: TimeJump): if time_source_changed or self.now() >= until: event.set() - def on_shutdown(): - """Wake when context is shut down.""" - event.set() - - context.on_shutdown(on_shutdown) + # Wake when context is shut down + context.on_shutdown(event.set) threshold = JumpThreshold( min_forward=Duration(nanoseconds=1),