On 06/13/2012 11:00 AM, Dave Cook wrote:
> Originally, I was trying to send formatted
> tracebacks back to the main process on a queue.
You can still do that:
import multiprocessing
import sys
def queueErrors(q):
def decorator(func):
def wrapped(*args, **kwargs):
try:
multiprocessing just mimicks the threading module here, see
http://bugs.python.org/issue1230540 . Why do you need excepthook in the
first place?
You can perfectly simulate it by wrapping the root method (target in
your example) in a try .. catch:
import multiprocessing
import sys
def printErrors
Why doesn't my excepthook get called in the child process?
import sys
import multiprocessing as mp
def target():
name = mp.current_process().name
def exceptHook(*args):
print 'exceptHook:', name, args
sys.excepthook = exceptHook
raise ValueError
if __name__=='__main__':