Skip to content

Commit

Permalink
Flush stdout buffer before print to stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis-Averin committed Feb 27, 2024
1 parent c421acf commit 81802c5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/check-urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,11 @@ def main(files):
queue.put_nowait(None)
checker.join()

if BROKEN_URLS:
# Flush stdout buffer before print to stderr
print("Errors:", flush=True)
for url, files in BROKEN_URLS.items():
print("BROKEN URL: '%s' in files: %s" % (url, ", ".join(files)), file=sys.stderr)
print("BROKEN URL: '%s' in files: %s" % (url, ", ".join(files)), file=sys.stderr, flush=True)
if BROKEN_URLS:
exit(1)

Expand Down

0 comments on commit 81802c5

Please sign in to comment.