interruptingcow

Software Screenshot:
interruptingcow
Software Details:
Version: 0.5
Upload Date: 14 Apr 15
Developer: Erik van Zijst
Distribution Type: Freeware
Downloads: 14

Rating: 1.5/5 (Total Votes: 2)

interruptingcow is a generic Python utility that can relatively gracefully interrupt your code when it doesn't execute within a specific number of seconds:

from interruptingcow import timeout

try:
 with timeout(5):
 # perform a potentially very slow operation
 pass
except RuntimeError:
 print "didn't finish within 5 seconds"


Installation

 pip install interruptingcow

Caveats

Interruptingcow uses signal(SIGALRM) to let the operating system interrupt program execution. This has the following limitations:

1. Python signal handlers only apply to the main thread, so you cannot use this from other threads
2. You must not use this in a program that uses SIGALRM itself

Requirements:

  • Python

Similar Software

PureTest
PureTest

11 May 15

exude
exude

20 Feb 15

LDasm
LDasm

3 Jun 15

Nemiver
Nemiver

17 Feb 15

Other Software of Developer Erik van Zijst

Dogslow
Dogslow

14 Apr 15

Comments to interruptingcow

Comments not found
Add Comment
Turn on images!