[Zope-Checkins] SVN: Zope/branches/2.9/lib/python/Zope2/Startup/zopectl.py Issue 2113: testrunner ignoring Ctrl-C.

Tres Seaver tseaver at palladion.com
Wed Jul 5 10:17:49 EDT 2006


Log message for revision 68971:
  Issue 2113:  testrunner ignoring Ctrl-C.

Changed:
  U   Zope/branches/2.9/lib/python/Zope2/Startup/zopectl.py

-=-
Modified: Zope/branches/2.9/lib/python/Zope2/Startup/zopectl.py
===================================================================
--- Zope/branches/2.9/lib/python/Zope2/Startup/zopectl.py	2006-07-05 13:44:29 UTC (rev 68970)
+++ Zope/branches/2.9/lib/python/Zope2/Startup/zopectl.py	2006-07-05 14:17:48 UTC (rev 68971)
@@ -258,14 +258,20 @@
         pid = os.fork()
         if pid == 0:  # child
             os.execv(self.options.python, args)
-        else:
-            os.waitpid(pid, 0)
+        
+        # Parent process running (execv replaces process in child
+        while True:
+            try:
+                os.waitpid(pid, 0)
+            except (OSError, KeyboardInterrupt):
+                continue
+            else:
+                break
 
     def help_test(self):
         print "test [args]+ -- run unit / functional tests."
         print "                See $ZOPE_HOME/bin/test.py --help for syntax."
 
-
 def main(args=None):
     # This is exactly like zdctl.main(), but uses ZopeCtlOptions and
     # ZopeCmd instead of ZDCtlOptions and ZDCmd, so the default values



More information about the Zope-Checkins mailing list