From: Zac Medico Date: Fri, 27 Jul 2012 22:46:47 +0000 (-0700) Subject: get_term_size: handle missing stty command X-Git-Tag: v2.2.0_alpha121~24 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0c46edc9290a459f693c12fbb34a2f361e40e168;p=portage.git get_term_size: handle missing stty command --- 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()