diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-01-27 09:52:37 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-01-27 09:52:37 (GMT) |
commit | 84a0fbf6b0c2d196ae3995697acf596094b94eb8 (patch) | |
tree | 78d5290cbf1e11903a6abfe6947922a9dbb661f6 /Lib/multiprocessing/process.py | |
parent | 9f6b02ecdedbd033be3e77960aa3abf314fa9db7 (diff) | |
download | cpython-84a0fbf6b0c2d196ae3995697acf596094b94eb8.zip cpython-84a0fbf6b0c2d196ae3995697acf596094b94eb8.tar.gz cpython-84a0fbf6b0c2d196ae3995697acf596094b94eb8.tar.bz2 |
Issue #13812: When a multiprocessing Process child raises an exception, flush stderr after printing the exception traceback.
Diffstat (limited to 'Lib/multiprocessing/process.py')
-rw-r--r-- | Lib/multiprocessing/process.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/multiprocessing/process.py b/Lib/multiprocessing/process.py index 5987af9..2b61ee9 100644 --- a/Lib/multiprocessing/process.py +++ b/Lib/multiprocessing/process.py @@ -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 # |