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 A88F8138331 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 B9359E0B21; 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 9D9D6E09EE for ; Sun, 29 Apr 2018 21:29:20 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (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 7DC53335C90 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 E85A1298 for ; Sun, 29 Apr 2018 21:29:17 +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.22fbdd3bf7de43c3bb216cd2da0623cd24280499.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: pym/_emerge/SpawnProcess.py X-VCS-Directories: pym/_emerge/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 22fbdd3bf7de43c3bb216cd2da0623cd24280499 X-VCS-Branch: master Date: Sun, 29 Apr 2018 21:29:17 +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: a3b3e489-c456-407b-ad06-9cbeb2562ea6 X-Archives-Hash: e5e842a2d892df277386892c38a3c464 commit: 22fbdd3bf7de43c3bb216cd2da0623cd24280499 Author: Zac Medico gentoo org> AuthorDate: Sun Apr 29 19:16:06 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=22fbdd3b SpawnProcess: fix deprecated _set_returncode (bug 654276) Move cleanup code from _set_returncode to _unregister, 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/SpawnProcess.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pym/_emerge/SpawnProcess.py b/pym/_emerge/SpawnProcess.py index 78eb5e9c0..f592c543d 100644 --- a/pym/_emerge/SpawnProcess.py +++ b/pym/_emerge/SpawnProcess.py @@ -117,8 +117,7 @@ class SpawnProcess(SubProcess): if isinstance(retval, int): # spawn failed - self._unregister() - self._set_returncode((self.pid, retval)) + self.returncode = retval self._async_wait() return @@ -172,9 +171,11 @@ class SpawnProcess(SubProcess): self._pipe_logger = None self._async_waitpid() - def _set_returncode(self, wait_retval): - SubProcess._set_returncode(self, wait_retval) - self._cgroup_cleanup() + def _unregister(self): + SubProcess._unregister(self) + if self.cgroup is not None: + self._cgroup_cleanup() + self.cgroup = None def _cancel(self): SubProcess._cancel(self)