flush streams before fork (#9203)

This commit is contained in:
skshetry
2023-03-17 17:14:34 +05:45
committed by GitHub
parent c52b12ac2a
commit 283d8245e1
+5
View File
@@ -56,6 +56,11 @@ def _spawn_windows(cmd, env):
def _spawn_posix(cmd, env):
from dvc.cli import main
if sys.stdout and not sys.stdout.closed:
sys.stdout.flush()
if sys.stderr and not sys.stderr.closed:
sys.stderr.flush()
# NOTE: using os._exit instead of sys.exit, because dvc built
# with PyInstaller has trouble with SystemExit exception and throws
# errors such as "[26338] Failed to execute script __main__"