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

pym/output.py

index 42e581159dd05b5543d09ea6b71851964aee986d..ab22275743495e4a73ec158314a7dd41db87ecdf 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: