From 85a7a776f03280e97bb335d0b3e677e61c36f0ce Mon Sep 17 00:00:00 2001 From: Pedro Avalos Jimenez Date: Fri, 8 Nov 2024 10:54:39 -0600 Subject: [PATCH] Flush on last print --- checkbox-support/checkbox_support/helpers/retry.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/checkbox-support/checkbox_support/helpers/retry.py b/checkbox-support/checkbox_support/helpers/retry.py index bb1ff4ac8..2f32ab307 100644 --- a/checkbox-support/checkbox_support/helpers/retry.py +++ b/checkbox-support/checkbox_support/helpers/retry.py @@ -50,16 +50,16 @@ def run_with_retry(f, max_attempts, delay, *args, **kwargs): attempt_string = "Attempt {}/{} (function '{}')".format( attempt, max_attempts, f.__name__ ) - print(flush=True) - print("=" * len(attempt_string), flush=True) - print(attempt_string, flush=True) + print() + print("=" * len(attempt_string)) + print(attempt_string) print("=" * len(attempt_string), flush=True) try: result = f(*args, **kwargs) return result except BaseException as e: - print("Attempt {} failed:".format(attempt), flush=True) - print(e, flush=True) + print("Attempt {} failed:".format(attempt)) + print(e) print(flush=True) if attempt >= max_attempts: print("All the attempts have failed!", flush=True)