Properly raise ValueError message in wait_for

This commit is contained in:
Greg Sanders 2022-12-16 14:17:23 -05:00 committed by Christian Decker
parent 5b3746172f
commit c79c9c73fc

View File

@ -90,7 +90,7 @@ def wait_for(success, timeout=TIMEOUT):
while not success(): while not success():
time_left = start_time + timeout - time.time() time_left = start_time + timeout - time.time()
if time_left <= 0: if time_left <= 0:
raise ValueError("Timeout while waiting for {}", success) raise ValueError("Timeout while waiting for {}".format(success))
time.sleep(min(interval, time_left)) time.sleep(min(interval, time_left))
interval *= 2 interval *= 2
if interval > 5: if interval > 5: