changeset 13208:b6693876c250

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 <module> 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: <lambda>() takes exactly 1 argument (2 given)
author Adrian Buehlmann <adrian@cadifra.com>
date Sun, 26 Dec 2010 11:59:07 +0100
parents 1775382ff833
children 501f979d26b6
files tests/test-static-http.t
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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 <<EOF
-  > 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 &