From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Ruzu2-0000lo-Fi for garchives@archives.gentoo.org; Wed, 08 Feb 2012 05:17:10 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0B40BE074E; Wed, 8 Feb 2012 05:17:02 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id D35EBE074E for ; Wed, 8 Feb 2012 05:17:02 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 56ADF1B4013 for ; Wed, 8 Feb 2012 05:17:02 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id C70F280043 for ; Wed, 8 Feb 2012 05:17:01 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <071fa4eb82ba9dbb2f0ae3c78cb87580eb6baeff.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: pym/_emerge/QueueScheduler.py X-VCS-Directories: pym/_emerge/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 071fa4eb82ba9dbb2f0ae3c78cb87580eb6baeff Date: Wed, 8 Feb 2012 05:17:01 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 941f8946-0b9b-4124-9194-05d9075ec8ec X-Archives-Hash: c514a9278471569b89abc9cd3c468a3b commit: 071fa4eb82ba9dbb2f0ae3c78cb87580eb6baeff Author: Zac Medico gentoo org> AuthorDate: Wed Feb 8 05:03:32 2012 +0000 Commit: Zac Medico gentoo org> CommitDate: Wed Feb 8 05:03:32 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D071fa4eb QueueScheduler: tweak timeout handling --- pym/_emerge/QueueScheduler.py | 23 +++++++++++++---------- 1 files changed, 13 insertions(+), 10 deletions(-) diff --git a/pym/_emerge/QueueScheduler.py b/pym/_emerge/QueueScheduler.p= y index 91a2831..db7aa5a 100644 --- a/pym/_emerge/QueueScheduler.py +++ b/pym/_emerge/QueueScheduler.py @@ -36,25 +36,28 @@ class QueueScheduler(PollScheduler): =20 def run(self, timeout=3DNone): =20 - timeout_id =3D None + timeout_callback =3D None if timeout is not None: def timeout_callback(): - raise StopIteration() - timeout_id =3D self._timeout_add(timeout, timeout_callback) + timeout_callback.timed_out =3D True + return False + timeout_callback.timed_out =3D False + timeout_callback.timeout_id =3D self._timeout_add( + timeout, timeout_callback) =20 try: =20 - while self._schedule(): + while not (timeout_callback is not None and + timeout_callback.timed_out) and self._schedule(): self._iteration() =20 - while self._running_job_count(): + while not (timeout_callback is not None and + timeout_callback.timed_out) and self._running_job_count(): self._iteration() =20 - except StopIteration: - pass - - if timeout_id is not None: - self._unregister(timeout_id) + finally: + if timeout_callback is not None: + self._unregister(timeout_callback.timeout_id) =20 def _schedule_tasks(self): """