◐ Shell
clean mode source ↗

Message 90960 - Python tracker

No, sorry.  You have just introduced the race condition by putting a print 
after the evt.set().  Setting the event causes the main thread to exit 
python and so anything after that line will likely not work.

In fact, this is probably the reason why we didn't get any sensible error 
output, because error of the evt.set in the finally.
Please try the modified version attatched.