py.lib
30:fe4a96d06243
Go to Latest
py.lib/Alarm.py
. Используем в логах monotonic вместо time
4 from signal import SIGALRM, alarm, signal
7 class AlarmTimeout(Exception):
11 def _handler(sig, frame):
12 raise AlarmTimeout('Operation timeout')
16 def __init__(self, timeout):
17 signal(SIGALRM, _handler)
23 def __exit__(self, e_type, e_obj, tb):