diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-05-28 01:35:55 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-05-28 01:35:55 +0000 |
commit | b1680637e07f76762f0188ec3ce9e27fd247805f (patch) | |
tree | 79ef752cb9fb81bf5a3fa3886e4147d51259e36d /pym | |
parent | c8780d7772b891bf08002c2e1475ef580ef94441 (diff) | |
download | portage-b1680637e07f76762f0188ec3ce9e27fd247805f.tar.gz portage-b1680637e07f76762f0188ec3ce9e27fd247805f.tar.bz2 portage-b1680637e07f76762f0188ec3ce9e27fd247805f.zip |
Make set_term_size() handle the CommandNotFound exception if stty
is missing for some reason. (trunk r10461)
svn path=/main/branches/2.1.2/; revision=10464
Diffstat (limited to 'pym')
-rw-r--r-- | pym/output.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pym/output.py b/pym/output.py index ff4bb62cf..c00ab00d4 100644 --- a/pym/output.py +++ b/pym/output.py @@ -7,7 +7,8 @@ __docformat__ = "epytext" import commands,errno,os,re,shlex,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 @@ -347,7 +348,10 @@ def set_term_size(lines, columns, fd): """ from portage_exec 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: """ |