]> granicus.if.org Git - python/commitdiff
Issue #21485: remove unnecesary .flush() calls in the asyncio subprocess code
authorVictor Stinner <victor.stinner@gmail.com>
Mon, 12 May 2014 21:25:09 +0000 (23:25 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Mon, 12 May 2014 21:25:09 +0000 (23:25 +0200)
example

Doc/library/asyncio-subprocess.rst

index 5b4ede61f60884d43526cabfe28484cd2a72ccdb..dc48eb53e587c657f4e3d610fc732e8413cc09c6 100644 (file)
@@ -262,9 +262,7 @@ display the output::
         stdout = stdout.decode('ascii').rstrip()
         print("Platform: %s" % stdout)
     else:
-        print("Python failed with exit code %s:" % exitcode)
-        sys.stdout.flush()
-        sys.stdout.buffer.flush()
+        print("Python failed with exit code %s:" % exitcode, flush=True)
         sys.stdout.buffer.write(stdout)
         sys.stdout.buffer.flush()
     loop.close()