[Zope3-checkins] CVS: Zope3 - test.py:1.60

Fred L. Drake, Jr. fred@zope.com
Wed, 28 May 2003 15:28:38 -0400


Update of /cvs-repository/Zope3
In directory cvs.zope.org:/tmp/cvs-serv13419

Modified Files:
	test.py 
Log Message:
Be more tolerant of running with output directed to a pipe.


=== Zope3/test.py 1.59 => 1.60 ===
--- Zope3/test.py:1.59	Wed May 14 05:14:56 2003
+++ Zope3/test.py	Wed May 28 15:28:38 2003
@@ -179,15 +179,19 @@
             self.dots = False
             self._progressWithNames = True
             self._lastWidth = 0
+            self._maxWidth = 80
             try:
                 import curses
             except ImportError:
-                self._maxWidth = 80
+                pass
             else:
                 import curses.wrapper
                 def get_max_width(scr, self=self):
                     self._maxWidth = scr.getmaxyx()[1]
-                curses.wrapper(get_max_width)
+                try:
+                    curses.wrapper(get_max_width)
+                except curses.error:
+                    pass
             self._maxWidth -= len("xxxx/xxxx (xxx.x%): ") + 1
 
     def stopTest(self, test):