From 01db2e45b1c21a9c521196bc21ab6cb2552a8d9f Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Fri, 6 Jan 2023 22:27:33 -0500 Subject: [PATCH] Use print() for some flush-y sys writes --- integration/_support/busywork.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/integration/_support/busywork.py b/integration/_support/busywork.py index d1e84a164..c3160a573 100644 --- a/integration/_support/busywork.py +++ b/integration/_support/busywork.py @@ -15,9 +15,7 @@ for i in range(num_cycles): out = "[{}] This is my stdout, there are many like it, but...\n".format(i) - sys.stdout.write(out) - sys.stdout.flush() + print(out, file=sys.stdout, flush=True) err = "[{}] To err is human, to stderr is superhuman\n".format(i) - sys.stderr.write(err) - sys.stderr.flush() + print(out, file=sys.stderr, flush=True) time.sleep(0.1)