[Zope3-checkins] SVN: zope.testing/trunk/src/zope/testing/testrunner.py Do not catch KeyboardInterrupt with bare excepts; that's very user-unfriendly.

Marius Gedminas marius at pov.lt
Fri Jan 12 10:47:30 EST 2007


Log message for revision 71974:
  Do not catch KeyboardInterrupt with bare excepts; that's very user-unfriendly.
  
  Merged from the mgedmin-fixes branch with
  
      svn merge -r 71951:71952 svn+ssh://svn.zope.org/repos/main/zope.testing/branches/mgedmin-fixes .
  
  

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	2007-01-12 15:45:05 UTC (rev 71973)
+++ zope.testing/trunk/src/zope/testing/testrunner.py	2007-01-12 15:47:28 UTC (rev 71974)
@@ -519,6 +519,8 @@
                 try:
                     try:
                         test.debug()
+                    except KeyboardInterrupt:
+                        raise
                     except:
                         result.addError(
                             test,
@@ -638,6 +640,8 @@
         line = suberr.readline()
         try:
             ran, nfail, nerr = map(int, line.strip().split())
+        except KeyboardInterrupt:
+            raise
         except:
             raise SubprocessError(line+suberr.read())
 
@@ -1103,6 +1107,8 @@
 
                 try:
                     module = import_name(module_name)
+                except KeyboardInterrupt:
+                    raise
                 except:
                     suite = StartUpFailure(
                         options, module_name,
@@ -1119,6 +1125,8 @@
                                 "Invalid test_suite, %r, in %s"
                                 % (suite, module_name)
                                 )
+                    except KeyboardInterrupt:
+                        raise
                     except:
                         suite = StartUpFailure(
                             options, module_name, sys.exc_info()[:2]+(None,))



More information about the Zope3-Checkins mailing list