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 warnings
|
||||||
import signal
|
import signal
|
||||||
|
|
||||||
HAS_ITIMER = False
|
alarm_func = signal.alarm
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import itimer
|
if hasattr(signal, 'setitimer'):
|
||||||
HAS_ITIMER = True
|
HAS_ITIMER = True
|
||||||
|
else:
|
||||||
|
import itimer
|
||||||
|
HAS_ITIMER = True
|
||||||
|
alarm_func = itimer.alarm
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user