Skip to content

Commit 16b854a

Browse files
Remove walrus operator
1 parent 4409e77 commit 16b854a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

controller_manager/controller_manager/hardware_spawner.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ def first_match(iterable, predicate):
4545

4646
def wait_for_value_or(function, node, timeout, default, description):
4747
while node.get_clock().now() < timeout:
48-
if result := function():
48+
result = function()
49+
if result:
4950
return result
5051
node.get_logger().info(
5152
f"Waiting for {description}", throttle_duration_sec=2, skip_first=True

controller_manager/controller_manager/spawner.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ def first_match(iterable, predicate):
5252

5353
def wait_for_value_or(function, node, timeout, default, description):
5454
while node.get_clock().now() < timeout:
55-
if result := function():
55+
result = function()
56+
if result:
5657
return result
5758
node.get_logger().info(
5859
f'Waiting for {description}',

0 commit comments

Comments
 (0)