Skip to content

Commit

Permalink
Flush on last print
Browse files Browse the repository at this point in the history
  • Loading branch information
pedro-avalos committed Nov 8, 2024
1 parent 33069ff commit 85a7a77
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions checkbox-support/checkbox_support/helpers/retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 85a7a77

Please sign in to comment.