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 9E3771382C5 for ; Wed, 24 Jun 2020 05:41:47 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AAD5CE0897; Wed, 24 Jun 2020 05:41:46 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 903E0E0897 for ; Wed, 24 Jun 2020 05:41:46 +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 2765B34F15C for ; Wed, 24 Jun 2020 05:41:45 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 362D22AE for ; Wed, 24 Jun 2020 05:41:39 +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: <1592976654.ac9184e0b0445a9294ae47f71abe7117799a4577.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: lib/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: lib/_emerge/SpawnProcess.py X-VCS-Directories: lib/_emerge/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: ac9184e0b0445a9294ae47f71abe7117799a4577 X-VCS-Branch: master Date: Wed, 24 Jun 2020 05:41:39 +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-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: caf43e7b-3592-4042-b29a-f64ab222394f X-Archives-Hash: d4826d6e89b18d26af65a610918a4506 commit: ac9184e0b0445a9294ae47f71abe7117799a4577 Author: Zac Medico gentoo org> AuthorDate: Wed Jun 24 05:11:53 2020 +0000 Commit: Zac Medico gentoo org> CommitDate: Wed Jun 24 05:30:54 2020 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=ac9184e0 SpawnProcess._async_wait: allow _main_task to exit normally Unnecessary cancellation of _main_task triggered this ResourceWarning for the ebuild(1) fetch command, since it prevented cleanup of BuildLogger's internal PipeLogger instance: sys:1: ResourceWarning: unclosed file <_io.FileIO name=10 mode='rb' closefd=True> Signed-off-by: Zac Medico gentoo.org> lib/_emerge/SpawnProcess.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/_emerge/SpawnProcess.py b/lib/_emerge/SpawnProcess.py index f96911571..60239a65a 100644 --- a/lib/_emerge/SpawnProcess.py +++ b/lib/_emerge/SpawnProcess.py @@ -172,12 +172,23 @@ class SpawnProcess(SubProcess): raise def _main_exit(self, main_task): + self._main_task = None try: main_task.result() except asyncio.CancelledError: self.cancel() self._async_waitpid() + def _async_wait(self): + # Allow _main_task to exit normally rather than via cancellation. + if self._main_task is None: + super(SpawnProcess, self)._async_wait() + + def _async_waitpid(self): + # Allow _main_task to exit normally rather than via cancellation. + if self._main_task is None: + super(SpawnProcess, self)._async_waitpid() + def _can_log(self, slave_fd): return True