commit: d16206ccd315edbd4bd7a46c0b1aa9e59a46db43 Author: Zac Medico <zmedico <AT> gentoo <DOT> org> AuthorDate: Thu Apr 26 07:45:32 2018 +0000 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> CommitDate: Thu Apr 26 08:02:28 2018 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=d16206cc
AsyncScheduler._poll(): fix event loop recursion (bug 591760) Call self._cleanup() and set the returncode, in order to avoid event loop recursion in self.wait(). Bug: https://bugs.gentoo.org/591760 pym/portage/util/_async/AsyncScheduler.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pym/portage/util/_async/AsyncScheduler.py b/pym/portage/util/_async/AsyncScheduler.py index b89b57dab..1b870c771 100644 --- a/pym/portage/util/_async/AsyncScheduler.py +++ b/pym/portage/util/_async/AsyncScheduler.py @@ -29,7 +29,12 @@ class AsyncScheduler(AsynchronousTask, PollScheduler): def _poll(self): if not (self._is_work_scheduled() or self._keep_scheduling()): - self.wait() + self._cleanup() + + if self._error_count > 0: + self.returncode = 1 + else: + self.returncode = os.EX_OK return self.returncode def _cancel(self):