# HG changeset patch # User Adrian Buehlmann # Date 2010-12-26 10:59:07 # 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 --git a/tests/test-static-http.t b/tests/test-static-http.t --- a/tests/test-static-http.t +++ b/tests/test-static-http.t @@ -10,7 +10,7 @@ This server doesn't do range requests so 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 @@ one pull > 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 &