Cross-platform time out decorator

Tim Golden mail at timgolden.me.uk
Thu Sep 27 07:57:34 EDT 2007


Joel wrote:
> I've been using this nice timing out decorator :
> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/307871 . The
> problem is that since it relies on sigalarm, it doesn't work under
> windows. Would anyone know how to do a cross-platform version?

I don't think you're going to find anything straightforward. AFAIK,
there's nothing on the Windows side of things which is directly
equivalent to the signals business in *nix. Sure, you can mess around
with timers and threads and events and so on. But it's far from being
the built-in tool which the signal module gives you.

TJG



More information about the Python-list mailing list