For bug #182571, handle curses.error if it's thrown inside get_term_size(). (trunk...
authorZac Medico <zmedico@gentoo.org>
Tue, 19 Jun 2007 19:58:44 +0000 (19:58 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 19 Jun 2007 19:58:44 +0000 (19:58 -0000)
svn path=/main/branches/2.1.2/; revision=6874

pym/output.py

index 2f8e63fcdbe81d79be2f48501b3d0f27dca8fcf9..42e581159dd05b5543d09ea6b71851964aee986d 100644 (file)
@@ -258,8 +258,11 @@ def get_term_size():
        """
        try:
                import curses
-               curses.setupterm()
-               return curses.tigetnum('lines'), curses.tigetnum('cols')
+               try:
+                       curses.setupterm()
+                       return curses.tigetnum('lines'), curses.tigetnum('cols')
+               except curses.error:
+                       pass
        except ImportError:
                pass
        st, out = commands.getstatusoutput('stty size')