aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-07-27 15:40:16 -0700
committerZac Medico <zmedico@gentoo.org>2012-07-27 15:40:16 -0700
commit50a99bba6cdb2cb97b3e65520a86e1da322460e7 (patch)
treefff7755b39221f304d40ee2de7ee60b07068beef
parentget_term_size: pass fd to curses.setupterm() (diff)
downloadgentoo-portage-50a99bba6cdb2cb97b3e65520a86e1da322460e7.tar.xz
gentoo-portage-50a99bba6cdb2cb97b3e65520a86e1da322460e7.zip
get_term_size: pass fd to stty
-rw-r--r--pym/portage/output.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/pym/portage/output.py b/pym/portage/output.py
index 4642a285ae..5129db77ef 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: