Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b0539b2

Browse files
committed
Issue #21485: remove unnecesary .flush() calls in the asyncio subprocess code
example
1 parent 7fe1049 commit b0539b2

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

Doc/library/asyncio-subprocess.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,7 @@ display the output::
262262
stdout = stdout.decode('ascii').rstrip()
263263
print("Platform: %s" % stdout)
264264
else:
265-
print("Python failed with exit code %s:" % exitcode)
266-
sys.stdout.flush()
267-
sys.stdout.buffer.flush()
265+
print("Python failed with exit code %s:" % exitcode, flush=True)
268266
sys.stdout.buffer.write(stdout)
269267
sys.stdout.buffer.flush()
270268
loop.close()

0 commit comments

Comments
 (0)