When I try to run the following code:
def sub_job_test():
global trace_back_msg
wait_time = 3 #random.randrange(0,13)
time.sleep(wait_time)
print("sub_job_test()")
try:
if wait_time < 4:
raise FileExistsError
except:
trace_back_msg= "".join(traceback.format_exception(*sys.exc_info()))
proc = multiprocessing.Process(target=sub_job_test)
start_time = time.time()
timeout = 7
proc.start()
proc.join(timeout=timeout)
proc.terminate()
I have a few problems:
- If I create a breakpoint in the sub_job_test, it will never be called. Why is that, and how can I get the breakpoint to be called?
- No print from the sub_job_test ever gets printed to the terminal... Is there a way to pass the print to the terminal?
- The exception does not get passed to the terminal. Is there a way to do it?