PollScheduler: fix _schedule() to return True v2.2.0_alpha137
authorZac Medico <zmedico@gentoo.org>
Wed, 10 Oct 2012 21:12:40 +0000 (14:12 -0700)
committerZac Medico <zmedico@gentoo.org>
Wed, 10 Oct 2012 21:12:40 +0000 (14:12 -0700)
This fixes a regression like bug #403895, introduced in commit
b696337bf20fdc539ce7721df7a4b42b35999705, since functions have to
return True in order to be continuously scheduled.

pym/_emerge/PollScheduler.py

index d02b0dafcae8bf5496023751ce820b1466452bfa..220394b41b4af580342d65564f8de96d04fa9bbe 100644 (file)
@@ -115,15 +115,17 @@ class PollScheduler(object):
                Calls _schedule_tasks() and automatically returns early from
                any recursive calls to this method that the _schedule_tasks()
                call might trigger. This makes _schedule() safe to call from
-               inside exit listeners.
+               inside exit listeners. This method always returns True, so that
+               it may be scheduled continuously via EventLoop.timeout_add().
                """
                if self._scheduling:
-                       return False
+                       return True
                self._scheduling = True
                try:
                        self._schedule_tasks()
                finally:
                        self._scheduling = False
+               return True
 
        def _is_work_scheduled(self):
                return bool(self._running_job_count())