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 E59CD13800E for ; Fri, 27 Jul 2012 22:40:37 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0A80EE0774; Fri, 27 Jul 2012 22:40:30 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id D4489E0774 for ; Fri, 27 Jul 2012 22:40:30 +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 4220D1B4091 for ; Fri, 27 Jul 2012 22:40:30 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 044B8E5436 for ; Fri, 27 Jul 2012 22:40:29 +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: <1343428816.50a99bba6cdb2cb97b3e65520a86e1da322460e7.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/output.py X-VCS-Directories: pym/portage/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 50a99bba6cdb2cb97b3e65520a86e1da322460e7 X-VCS-Branch: master Date: Fri, 27 Jul 2012 22:40:29 +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: 301eb5f9-f1f4-4122-991a-468a6f68bf84 X-Archives-Hash: c92ff78e216e0e966fb68d3f75916b13 commit: 50a99bba6cdb2cb97b3e65520a86e1da322460e7 Author: Zac Medico gentoo org> AuthorDate: Fri Jul 27 22:40:16 2012 +0000 Commit: Zac Medico gentoo org> CommitDate: Fri Jul 27 22:40:16 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=50a99bba get_term_size: pass fd to stty --- pym/portage/output.py | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pym/portage/output.py b/pym/portage/output.py index 4642a28..5129db7 100644 --- a/pym/portage/output.py +++ b/pym/portage/output.py @@ -7,6 +7,7 @@ import errno import io import formatter import re +import subprocess import sys import portage @@ -448,8 +449,11 @@ def get_term_size(fd=None): pass except ImportError: pass - st, out = portage.subprocess_getstatusoutput('stty size') - if st == os.EX_OK: + + proc = subprocess.Popen(["stty", "size"], + stdout=subprocess.PIPE, stderr=fd) + out = _unicode_decode(proc.communicate()[0]) + if proc.wait() == os.EX_OK: out = out.split() if len(out) == 2: try: