[Zope3-checkins] SVN: zope.testing/trunk/src/zope/testing/testrunner.py Made the test runner less susceptible to Python 2.3 partial import of

Jim Fulton jim at zope.com
Tue Nov 1 15:22:32 EST 2005


Log message for revision 39826:
  Made the test runner less susceptible to Python 2.3 partial import of
  the curses module.
  

Changed:
  U   zope.testing/trunk/src/zope/testing/testrunner.py

-=-
Modified: zope.testing/trunk/src/zope/testing/testrunner.py
===================================================================
--- zope.testing/trunk/src/zope/testing/testrunner.py	2005-11-01 20:22:24 UTC (rev 39825)
+++ zope.testing/trunk/src/zope/testing/testrunner.py	2005-11-01 20:22:32 UTC (rev 39826)
@@ -609,11 +609,16 @@
             try:
                 # Note that doing this every time is more test friendly.
                 import curses
-                curses.setupterm()
-            except (ImportError, TypeError):
-                pass
+            except ImportError:
+                # avoid repimporting a broken module in python 2.3
+                sys.modules['curses'] = None
             else:
-                self.max_width = curses.tigetnum('cols')
+                try:
+                    curses.setupterm()
+                except TypeError:
+                    pass
+                else:
+                    self.max_width = curses.tigetnum('cols')
 
     def getShortDescription(self, test, room):
         room -= 1



More information about the Zope3-Checkins mailing list