Commit f8ebfb5a authored by Tres Seaver's avatar Tres Seaver

Issue 2113: testrunner ignoring Ctrl-C.

parent 5180cccb
...@@ -258,14 +258,20 @@ class ZopeCmd(ZDCmd): ...@@ -258,14 +258,20 @@ class ZopeCmd(ZDCmd):
pid = os.fork() pid = os.fork()
if pid == 0: # child if pid == 0: # child
os.execv(self.options.python, args) 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): def help_test(self):
print "test [args]+ -- run unit / functional tests." print "test [args]+ -- run unit / functional tests."
print " See $ZOPE_HOME/bin/test.py --help for syntax." print " See $ZOPE_HOME/bin/test.py --help for syntax."
def main(args=None): def main(args=None):
# This is exactly like zdctl.main(), but uses ZopeCtlOptions and # This is exactly like zdctl.main(), but uses ZopeCtlOptions and
# ZopeCmd instead of ZDCtlOptions and ZDCmd, so the default values # ZopeCmd instead of ZDCtlOptions and ZDCmd, so the default values
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment