Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Catch exception from forked subprocess

I use fork to give certain methods only a fixed time for execution. These methods might, however, raise an exception and I don't know how to catch these. The code:

@fork
def test() :
    raise ValueError("Found a value error")

try :
    test()
except ValueError :
    print("Value error caught")

does not catch the error. Is there a way to do this?