From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id BE4291382C5 for ; Thu, 19 Apr 2018 06:28:53 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C5AB2E0857; Thu, 19 Apr 2018 06:28:52 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A6243E0857 for ; Thu, 19 Apr 2018 06:28:52 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6AC22335C73 for ; Thu, 19 Apr 2018 06:28:51 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 278ED288 for ; Thu, 19 Apr 2018 06:28:49 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1524119132.128c13ff8bd9a1685fb844f7a83469b2271f5e0f.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/util/_async/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/util/_async/AsyncTaskFuture.py X-VCS-Directories: pym/portage/util/_async/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 128c13ff8bd9a1685fb844f7a83469b2271f5e0f X-VCS-Branch: master Date: Thu, 19 Apr 2018 06:28:49 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 4e51e136-8955-4a59-a90c-477aa5c36790 X-Archives-Hash: 68d9b8766ca16fb52070dea0030f34d1 commit: 128c13ff8bd9a1685fb844f7a83469b2271f5e0f Author: Zac Medico gentoo org> AuthorDate: Thu Apr 19 06:19:00 2018 +0000 Commit: Zac Medico gentoo org> CommitDate: Thu Apr 19 06:25:32 2018 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=128c13ff AsyncTaskFuture: override _wait method If the _wait method is called before the future is done, then wait for it to complete. pym/portage/util/_async/AsyncTaskFuture.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pym/portage/util/_async/AsyncTaskFuture.py b/pym/portage/util/_async/AsyncTaskFuture.py index ee39183fe..c2316deeb 100644 --- a/pym/portage/util/_async/AsyncTaskFuture.py +++ b/pym/portage/util/_async/AsyncTaskFuture.py @@ -29,3 +29,8 @@ class AsyncTaskFuture(AsynchronousTask): else: self.returncode = 1 self.wait() + + def _wait(self): + if self.returncode is None: + self.scheduler.run_until_complete(self.future) + return self.returncode