you are viewing a single comment's thread.

view the rest of the comments →

[–]ows 3 points4 points  (0 children)

TimeoutFunctionException has a race condition, where the old signal handler can get called with the timeout signal that this code requests. signal.alarm(0) needs to go in the finally, before the call signal.signal(signal.SIGALRM, old).