Return early from get_term_size() is stdout is not a tty.
authorZac Medico <zmedico@gentoo.org>
Tue, 19 Jun 2007 20:11:34 +0000 (20:11 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 19 Jun 2007 20:11:34 +0000 (20:11 -0000)
svn path=/main/trunk/; revision=6875

pym/portage/output.py

index bb355f6d7742c5512cd821a5b58206f776608e4e..78d0dcfd263824add827e18fff4fae3b6de57607 100644 (file)
@@ -256,6 +256,8 @@ def get_term_size():
        occurs. The curses module is used if available, otherwise the output of
        `stty size` is parsed.
        """
+       if not sys.stdout.isatty():
+               return -1, -1
        try:
                import curses
                try: