get_term_size: check if sys.stderr.isatty()
authorFederico "fox" Scrinzi <fox91@anche.no>
Sun, 22 Jul 2012 21:52:01 +0000 (14:52 -0700)
committerZac Medico <zmedico@gentoo.org>
Sun, 22 Jul 2012 21:52:01 +0000 (14:52 -0700)
pym/portage/output.py

index 75503917bebd07fcf85b9ed8ce4318df1a9735ea..c6a7031d0e06e765352ac61acdcf283c454b3075 100644 (file)
@@ -434,7 +434,7 @@ def get_term_size():
        greater than or equal to zero, since a negative COLUMNS variable is
        known to prevent some commands from working (see bug #394091).
        """
-       if not sys.stdout.isatty():
+       if not (sys.stdout.isatty() or sys.stderr.isatty()):
                return (0, 0)
        try:
                import curses