Python: set a function timeout without using signal or threads?

Posted by Heinrich Schmetterling on Stack Overflow See other posts from Stack Overflow or by Heinrich Schmetterling
Published on 2010-05-20T22:59:29Z Indexed on 2010/05/20 23:30 UTC
Read the original article Hit count: 148

Filed under:

Is there a way to have a function raise an error if it takes longer than a certain amount of time to return? I want to do this without using signal (because I am not in the main thread) or by spawning more threads, which is cumbersome.

© Stack Overflow or respective owner

Related posts about python