multiprocessing: excepthook not getting called

Dave Cook daverz at gmail.com
Tue Jun 12 17:02:43 EDT 2012


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__':
    p = mp.Process(target=target)
    p.start()
    p.join()
    # try it here in main
    target()

Thanks,
Dave Cook



More information about the Python-list mailing list