diff options
author | Zac Medico <zmedico@gentoo.org> | 2012-07-27 15:46:47 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2012-07-27 15:46:47 -0700 |
commit | 0c46edc9290a459f693c12fbb34a2f361e40e168 (patch) | |
tree | bbba24e89d8809174aeb8aed3a07cb4d2d8d0ba1 | |
parent | 50a99bba6cdb2cb97b3e65520a86e1da322460e7 (diff) | |
download | portage-0c46edc9290a459f693c12fbb34a2f361e40e168.tar.gz portage-0c46edc9290a459f693c12fbb34a2f361e40e168.tar.bz2 portage-0c46edc9290a459f693c12fbb34a2f361e40e168.zip |
get_term_size: handle missing stty command
-rw-r--r-- | pym/portage/output.py | 11 |
1 files 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() |