diff --git a/rclpy/rclpy/waitable.py b/rclpy/rclpy/waitable.py index 330091bb1..d98c77212 100644 --- a/rclpy/rclpy/waitable.py +++ b/rclpy/rclpy/waitable.py @@ -36,10 +36,12 @@ def __init__( def __add__(self, other): result = self.__class__() - for attr in result.__slots__: - left = getattr(self, attr) - right = getattr(other, attr) - setattr(result, attr, left + right) + result.num_subscriptions = self.num_subscriptions + other.num_subscriptions + result.num_guard_conditions = self.num_guard_conditions + other.num_guard_conditions + result.num_timers = self.num_timers + other.num_timers + result.num_clients = self.num_clients + other.num_clients + result.num_services = self.num_services + other.num_services + result.num_events = self.num_events + other.num_events return result def __iadd__(self, other):