# HG changeset patch # User Adrian Buehlmann # Date 1293361147 -3600 # Node ID b6693876c25033fa7776dd042586cbd112f28a21 # Parent 1775382ff833e90a849e96b4724f23f352231fbe test-static-http.t: get kill actually working - signal handlers take two arguments, not one - add missing import sys Before this patch, the $ kill $! at the end of the test just caused a hidden traceback, sys.exit(0) was not executed. The swallowed traceback was: Traceback (most recent call last): File "dumb.py", line 10, in run() File "dumb.py", line 7, in run httpd.serve_forever() File "/usr/lib/python2.6/SocketServer.py", line 224, in serve_forever r, w, e = select.select([self], [], [], poll_interval) TypeError: () takes exactly 1 argument (2 given) diff -r 1775382ff833 -r b6693876c250 tests/test-static-http.t --- a/tests/test-static-http.t Fri Dec 24 15:22:00 2010 +0100 +++ b/tests/test-static-http.t Sun Dec 26 11:59:07 2010 +0100 @@ -10,7 +10,7 @@ one pull $ cat > dumb.py < import BaseHTTPServer, SimpleHTTPServer, os, signal + > import BaseHTTPServer, SimpleHTTPServer, os, signal, sys > > def run(server_class=BaseHTTPServer.HTTPServer, > handler_class=SimpleHTTPServer.SimpleHTTPRequestHandler): @@ -18,7 +18,7 @@ > httpd = server_class(server_address, handler_class) > httpd.serve_forever() > - > signal.signal(signal.SIGTERM, lambda x: sys.exit(0)) + > signal.signal(signal.SIGTERM, lambda x, y: sys.exit(0)) > run() > EOF $ python dumb.py 2>/dev/null &