diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-01-27 09:53:35 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-01-27 09:53:35 (GMT) |
commit | 2d843d25204af3a791f31b1b941675da49be82ed (patch) | |
tree | 8726d48e8a575217c26ea4a0a5ceaf19d9bd70b5 /Lib/multiprocessing/process.py | |
parent | e10ae8871a057d6afb5a4c5650e0ed029f13721d (diff) | |
parent | 84a0fbf6b0c2d196ae3995697acf596094b94eb8 (diff) | |
download | cpython-2d843d25204af3a791f31b1b941675da49be82ed.zip cpython-2d843d25204af3a791f31b1b941675da49be82ed.tar.gz cpython-2d843d25204af3a791f31b1b941675da49be82ed.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 98ce0da..b599f11 100644 --- a/Lib/multiprocessing/process.py +++ b/Lib/multiprocessing/process.py @@ -291,16 +291,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 # |