diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-05-28 01:13:40 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-05-28 01:13:40 +0000 |
commit | 832f4b7e9014ca9af666d6c3af7f261bf270fd2e (patch) | |
tree | 102f7ca003209e9d698d70ac99fea042f7ae160f | |
parent | cb264456ddc7c0df50f5629ffa27e7ed75112ab2 (diff) | |
download | portage-832f4b7e9014ca9af666d6c3af7f261bf270fd2e.tar.gz portage-832f4b7e9014ca9af666d6c3af7f261bf270fd2e.tar.bz2 portage-832f4b7e9014ca9af666d6c3af7f261bf270fd2e.zip |
Make set_term_size() handle the CommandNotFound exception if stty
is missing for some reason.
svn path=/main/trunk/; revision=10461
-rw-r--r-- | 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 e9a1a559a..a7a500cd4 100644 --- a/pym/portage/output.py +++ b/pym/portage/output.py @@ -13,7 +13,8 @@ import shlex import sys from portage.const import COLOR_MAP_FILE from portage.util import writemsg -from portage.exception import PortageException, ParseError, PermissionDenied, FileNotFound +from portage.exception import CommandNotFound, FileNotFound, \ + ParseError, PermissionDenied, PortageException havecolor=1 dotitles=1 @@ -405,7 +406,10 @@ def set_term_size(lines, columns, fd): """ from portage.process import spawn cmd = ["stty", "rows", str(lines), "columns", str(columns)] - spawn(cmd, env=os.environ, fd_pipes={0:fd}) + try: + spawn(cmd, env=os.environ, fd_pipes={0:fd}) + except CommandNotFound: + writemsg("portage: stty: command not found\n", noiselevel=-1) class EOutput(object): """ |