diff options
| author | Antoine Pitrou <pitrou@free.fr> | 2018-03-11 18:21:38 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-03-11 18:21:38 (GMT) |
| commit | e756f66c83786ee82f5f7d45931ae50a6931dd7f (patch) | |
| tree | f3d6b9bd7d6319fc3149841bb7498e326d9fe7c9 /Lib/multiprocessing/process.py | |
| parent | 9fb84157595a385f15799e5d0729c1e1b0ba9d38 (diff) | |
| download | cpython-e756f66c83786ee82f5f7d45931ae50a6931dd7f.zip cpython-e756f66c83786ee82f5f7d45931ae50a6931dd7f.tar.gz cpython-e756f66c83786ee82f5f7d45931ae50a6931dd7f.tar.bz2 | |
bpo-31804: Fix multiprocessing.Process with broken standard streams (#6079)
In some conditions the standard streams will be None or closed in the child process (for example if using "pythonw" instead of "python" on Windows). Avoid failing with a non-0 exit code in those conditions.
Report and initial patch by poxthegreat.
Diffstat (limited to 'Lib/multiprocessing/process.py')
| -rw-r--r-- | Lib/multiprocessing/process.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/multiprocessing/process.py b/Lib/multiprocessing/process.py index 8fff3e1..cd592d0 100644 --- a/Lib/multiprocessing/process.py +++ b/Lib/multiprocessing/process.py @@ -314,8 +314,7 @@ class BaseProcess(object): finally: threading._shutdown() util.info('process exiting with exitcode %d' % exitcode) - sys.stdout.flush() - sys.stderr.flush() + util._flush_std_streams() return exitcode |
