From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id AE090138010 for ; Wed, 22 Aug 2012 21:13:22 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3C72AE043A; Wed, 22 Aug 2012 21:12:55 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 0F1C7E043A for ; Wed, 22 Aug 2012 21:12:54 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6426933DDF3 for ; Wed, 22 Aug 2012 21:12:49 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 27000E543D for ; Wed, 22 Aug 2012 21:12:48 +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: <1345669951.5335ccb6558f22ddc926714dcba4443cc7333b6a.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: pym/_emerge/EbuildMetadataPhase.py pym/_emerge/SpawnProcess.py X-VCS-Directories: pym/_emerge/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 5335ccb6558f22ddc926714dcba4443cc7333b6a X-VCS-Branch: master Date: Wed, 22 Aug 2012 21:12:48 +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: 7c782839-298b-4216-a14f-e88813cde0f6 X-Archives-Hash: 22196d7a8dd6795bfd79a4f9e426e887 commit: 5335ccb6558f22ddc926714dcba4443cc7333b6a Author: Zac Medico gentoo org> AuthorDate: Wed Aug 22 21:12:31 2012 +0000 Commit: Zac Medico gentoo org> CommitDate: Wed Aug 22 21:12:31 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5335ccb6 Optimize sys.std* flush code. --- pym/_emerge/EbuildMetadataPhase.py | 5 +++-- pym/_emerge/SpawnProcess.py | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pym/_emerge/EbuildMetadataPhase.py b/pym/_emerge/EbuildMetadataPhase.py index d49c51f..9ab03e2 100644 --- a/pym/_emerge/EbuildMetadataPhase.py +++ b/pym/_emerge/EbuildMetadataPhase.py @@ -78,11 +78,12 @@ class EbuildMetadataPhase(SubProcess): fd_pipes.setdefault(2, sys.__stderr__.fileno()) # flush any pending output + stdout_filenos = (sys.__stdout__.fileno(), sys.__stderr__.fileno()) for fd in fd_pipes.values(): - if fd == sys.__stdout__.fileno(): + if fd in stdout_filenos: sys.__stdout__.flush() - if fd == sys.__stderr__.fileno(): sys.__stderr__.flush() + break self._files = self._files_dict() files = self._files diff --git a/pym/_emerge/SpawnProcess.py b/pym/_emerge/SpawnProcess.py index dfcf088..c7863c1 100644 --- a/pym/_emerge/SpawnProcess.py +++ b/pym/_emerge/SpawnProcess.py @@ -67,11 +67,12 @@ class SpawnProcess(SubProcess): fd_pipes.setdefault(2, sys.__stderr__.fileno()) # flush any pending output + stdout_filenos = (sys.__stdout__.fileno(), sys.__stderr__.fileno()) for fd in fd_pipes.values(): - if fd == sys.__stdout__.fileno(): + if fd in stdout_filenos: sys.__stdout__.flush() - if fd == sys.__stderr__.fileno(): sys.__stderr__.flush() + break if logfile is not None: