projects
/
portage.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
50a99bb
)
get_term_size: handle missing stty command
author
Zac Medico
<zmedico@gentoo.org>
Fri, 27 Jul 2012 22:46:47 +0000
(15:46 -0700)
committer
Zac Medico
<zmedico@gentoo.org>
Fri, 27 Jul 2012 22:46:47 +0000
(15:46 -0700)
pym/portage/output.py
patch
|
blob
|
history
diff --git
a/pym/portage/output.py
b/pym/portage/output.py
index 5129db77ef4fa270272c0abc5375ecc6012313d4..e44375ee38451ba304d14a054a5fd6752027cafe 100644
(file)
--- 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()