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

pym/portage/output.py

index a2ed22dc3be53617043c7feaad653712dd700db9..bb355f6d7742c5512cd821a5b58206f776608e4e 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')