Revision 6b27f535 lib/utils/__init__.py
b/lib/utils/__init__.py | ||
---|---|---|
32 | 32 |
import re |
33 | 33 |
import errno |
34 | 34 |
import pwd |
35 |
import time |
|
35 | 36 |
import itertools |
36 | 37 |
import select |
37 | 38 |
import logging |
... | ... | |
566 | 567 |
return wrap |
567 | 568 |
|
568 | 569 |
|
570 |
def TimeoutExpired(epoch, timeout, _time_fn=time.time): |
|
571 |
"""Checks whether a timeout has expired. |
|
572 |
|
|
573 |
""" |
|
574 |
return _time_fn() > (epoch + timeout) |
|
575 |
|
|
576 |
|
|
569 | 577 |
class SignalWakeupFd(object): |
570 | 578 |
try: |
571 | 579 |
# This is only supported in Python 2.5 and above (some distributions |
Also available in: Unified diff