add a note why we are flushing (#9205)

This commit is contained in:
skshetry
2023-03-17 17:52:04 +05:45
committed by GitHub
parent 283d8245e1
commit a2066d75f9
+2
View File
@@ -56,6 +56,8 @@ def _spawn_windows(cmd, env):
def _spawn_posix(cmd, env):
from dvc.cli import main
# `fork` will copy buffers, so we need to flush them before forking.
# Otherwise, we will get duplicated outputs.
if sys.stdout and not sys.stdout.closed:
sys.stdout.flush()
if sys.stderr and not sys.stderr.closed: