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 E52781382C5 for ; Sun, 29 Apr 2018 21:29:21 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D3756E09F0; Sun, 29 Apr 2018 21:29:20 +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 B1AF1E0B1E for ; Sun, 29 Apr 2018 21:29:20 +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 A7F6C335CA1 for ; Sun, 29 Apr 2018 21:29:19 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 077ED29F for ; Sun, 29 Apr 2018 21:29:18 +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: <1525033652.08f03935b92e8fcacf95c583e389f349f5db67b8.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: pym/_emerge/AbstractEbuildProcess.py X-VCS-Directories: pym/_emerge/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 08f03935b92e8fcacf95c583e389f349f5db67b8 X-VCS-Branch: master Date: Sun, 29 Apr 2018 21:29:18 +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: eb96fd80-59ba-47e9-a8de-5048150e7209 X-Archives-Hash: 5009a574840b97be0a90e279b69586fc commit: 08f03935b92e8fcacf95c583e389f349f5db67b8 Author: Zac Medico gentoo org> AuthorDate: Sun Apr 29 19:09:00 2018 +0000 Commit: Zac Medico gentoo org> CommitDate: Sun Apr 29 20:27:32 2018 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=08f03935 AbstractEbuildProcess: fix deprecated _set_returncode (bug 654276) Move cleanup code from _set_returncode to _async_waitpid_cb, since _set_returncode expects an os.waitpid return value which is inconveniently different from the returncode that is passed to asyncio.AbstractChildWatcher.add_child_handler callbacks. Bug: https://bugs.gentoo.org/654276 pym/_emerge/AbstractEbuildProcess.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py index 03c834912..2ed175750 100644 --- a/pym/_emerge/AbstractEbuildProcess.py +++ b/pym/_emerge/AbstractEbuildProcess.py @@ -64,7 +64,7 @@ class AbstractEbuildProcess(SpawnProcess): "since PORTAGE_BUILDDIR does not exist: '%s'") % \ (self.phase, self.settings['PORTAGE_BUILDDIR']) self._eerror(textwrap.wrap(msg, 72)) - self._set_returncode((self.pid, 1 << 8)) + self.returncode = 1 self._async_wait() return @@ -355,8 +355,12 @@ class AbstractEbuildProcess(SpawnProcess): ["%s received strange poll event: %s\n" % \ (self.__class__.__name__, event,)]) - def _set_returncode(self, wait_retval): - SpawnProcess._set_returncode(self, wait_retval) + def _async_waitpid_cb(self, *args, **kwargs): + """ + Override _async_waitpid_cb to perform cleanup that is + not necessarily idempotent. + """ + SpawnProcess._async_waitpid_cb(self, *args, **kwargs) if self._exit_timeout_id is not None: self.scheduler.source_remove(self._exit_timeout_id)