Add support for using signal.setitimer or the itimer module for blocking detection

The itimer module can be found here: http://github.com/slideinc/itimer
for versions of Python prior to 2.6
This commit is contained in:
R. Tyler Ballance
2010-08-24 13:00:23 -07:00
parent 450f885377
commit 337c2047ad

View File

@@ -4,10 +4,15 @@ import traceback
import warnings
import signal
HAS_ITIMER = False
alarm_func = signal.alarm
try:
import itimer
HAS_ITIMER = True
if hasattr(signal, 'setitimer'):
HAS_ITIMER = True
else:
import itimer
HAS_ITIMER = True
alarm_func = itimer.alarm
except ImportError:
pass