From e09d2d0ae5271ac85993766ec027e844ccef0776 Mon Sep 17 00:00:00 2001 From: James Bunton Date: Wed, 12 Nov 2014 16:32:14 +1100 Subject: [PATCH] Always use poll --- asyncsched.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/asyncsched.py b/asyncsched.py index 5fd8348..7edba81 100644 --- a/asyncsched.py +++ b/asyncsched.py @@ -41,14 +41,6 @@ def loop(timeout=30.0, use_poll=False): running = True oldhandler = signal.signal(signal.SIGTERM, exit) - if use_poll: - if hasattr(select, 'poll'): - poll_fun = asyncore.poll3 - else: - poll_fun = asyncore.poll2 - else: - poll_fun = asyncore.poll - while running: now = time.time() while tasks and tasks[0].time < now: @@ -59,7 +51,7 @@ def loop(timeout=30.0, use_poll=False): if tasks: t = max(min(t, tasks[0].time - now), 0) - poll_fun(timeout=t) + asyncore.poll2(timeout=t) signal.signal(signal.SIGTERM, oldhandler) -- 2.39.2