From 0c46edc9290a459f693c12fbb34a2f361e40e168 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 27 Jul 2012 15:46:47 -0700 Subject: [PATCH] get_term_size: handle missing stty command --- pym/portage/output.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pym/portage/output.py b/pym/portage/output.py index 5129db77e..e44375ee3 100644 --- a/pym/portage/output.py +++ b/pym/portage/output.py @@ -450,8 +450,15 @@ def get_term_size(fd=None): except ImportError: pass - proc = subprocess.Popen(["stty", "size"], - stdout=subprocess.PIPE, stderr=fd) + try: + proc = subprocess.Popen(["stty", "size"], + stdout=subprocess.PIPE, stderr=fd) + except EnvironmentError as e: + if e.errno != errno.ENOENT: + raise + # stty command not found + return (0, 0) + out = _unicode_decode(proc.communicate()[0]) if proc.wait() == os.EX_OK: out = out.split() -- 2.26.2