summaryrefslogtreecommitdiff
path: root/Lib/multiprocessing/process.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-01-27 10:53:35 +0100
committerAntoine Pitrou <solipsis@pitrou.net>2012-01-27 10:53:35 +0100
commit4263ab93dbbd4d46043ca0b77996e275b7ca66ee (patch)
tree153f1216e7708705c83be056283dfaa2a9f5cb9b /Lib/multiprocessing/process.py
parent02a82f34fb70ae44c9eb482d9bfcef28651e80d7 (diff)
parentabfe13f5dc7a06a415840e19a68cf890b040b8a0 (diff)
downloadcpython-4263ab93dbbd4d46043ca0b77996e275b7ca66ee.tar.gz
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.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/multiprocessing/process.py b/Lib/multiprocessing/process.py
index 98ce0da6c0..b599f11606 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
#