I haven't tried python3 yet. But for me, to catch the errors in the child process, I put the function that runs in child process within a
import traceback
try:
your code that can make error
except Exception as e:
print e
return False, traceback.format_exc()
else:
return True, result
So that I will know if something goes wrong.
EDIT: I change the return format as OP's comment so that the child process returns a tuple (is_success, result or error traceback message )
So that main process will first read the flag is_success
and then handles the second argument accordingly.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…