mirror of
https://github.com/python/cpython.git
synced 2025-10-05 14:41:07 +00:00
bpo-31804: Fix multiprocessing.Process with broken standard streams (GH-6079) (GH-6080)
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.
(cherry picked from commit e756f66c83
)
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
This commit is contained in:
parent
04aadf23ea
commit
ff5d21331e
5 changed files with 47 additions and 12 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue