From cda8009b77feda580ee57f576d6fcaadc9ca65fc Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 8 Feb 2012 18:10:38 -0800 Subject: [PATCH] PollScheduler: remove EventLoop._schedule hook PollScheduler and subclasses be should already be calling self._schedule() when necessary. --- pym/_emerge/PollScheduler.py | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/pym/_emerge/PollScheduler.py b/pym/_emerge/PollScheduler.py index ee00f1001..ab6505411 100644 --- a/pym/_emerge/PollScheduler.py +++ b/pym/_emerge/PollScheduler.py @@ -46,10 +46,6 @@ class EventLoop(object): self._poll_obj = create_poll_instance() self._polling = False - def _schedule(self): - pass - - def _poll(self, timeout=None): if self._polling: return @@ -107,12 +103,11 @@ class EventLoop(object): StopIteration if timeout is None and there are no file descriptors to poll. """ - if not self._poll_event_handlers: - self._schedule() - if timeout is None and \ - not self._poll_event_handlers: - raise StopIteration( - "timeout is None and there are no poll() event handlers") + + if timeout is None and \ + not self._poll_event_handlers: + raise StopIteration( + "timeout is None and there are no poll() event handlers") # The following error is known to occur with Linux kernel versions # less than 2.6.24: @@ -367,7 +362,6 @@ class PollScheduler(object): "source_remove", "timeout_add", "unregister") def __init__(self): - super(PollScheduler, self).__init__() self._terminated = threading.Event() self._terminated_tasks = False self._max_jobs = 1 @@ -376,7 +370,6 @@ class PollScheduler(object): self._scheduling = False self._background = False self._event_loop = EventLoop() - self._event_loop._schedule = self._schedule self.sched_iface = self._sched_iface_class( idle_add=self._event_loop.idle_add, io_add_watch=self._event_loop.io_add_watch, -- 2.26.2