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:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user