mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Issue #13812: When a multiprocessing Process child raises an exception, flush stderr after printing the exception traceback.
This commit is contained in:
parent
9f6b02ecde
commit
84a0fbf6b0
4 changed files with 30 additions and 5 deletions
|
@ -275,16 +275,17 @@ class Process(object):
|
|||
exitcode = e.args[0]
|
||||
else:
|
||||
sys.stderr.write(e.args[0] + '\n')
|
||||
sys.stderr.flush()
|
||||
exitcode = 1
|
||||
except:
|
||||
exitcode = 1
|
||||
import traceback
|
||||
sys.stderr.write('Process %s:\n' % self.name)
|
||||
sys.stderr.flush()
|
||||
traceback.print_exc()
|
||||
finally:
|
||||
util.info('process exiting with exitcode %d' % exitcode)
|
||||
sys.stdout.flush()
|
||||
sys.stderr.flush()
|
||||
|
||||
util.info('process exiting with exitcode %d' % exitcode)
|
||||
return exitcode
|
||||
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue