summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorR. David Murray <rdmurray@bitdance.com>2010-05-28 18:17:20 (GMT)
committerR. David Murray <rdmurray@bitdance.com>2010-05-28 18:17:20 (GMT)
commitcbd7d3dbf2c1dc66411d9bcebbd8c6dbca2e41e4 (patch)
tree9a45cb5df850bd8850b5f8f46f752b344f07f9a6 /Tools
parente5d1c052166d0a6cbb087f21c1bba5184019bfd6 (diff)
downloadcpython-cbd7d3dbf2c1dc66411d9bcebbd8c6dbca2e41e4.zip
cpython-cbd7d3dbf2c1dc66411d9bcebbd8c6dbca2e41e4.tar.gz
cpython-cbd7d3dbf2c1dc66411d9bcebbd8c6dbca2e41e4.tar.bz2
Make the ctl-C shutdown of serve.py prettier.
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/scripts/serve.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Tools/scripts/serve.py b/Tools/scripts/serve.py
index b8d9cd7..50061d5 100755
--- a/Tools/scripts/serve.py
+++ b/Tools/scripts/serve.py
@@ -28,5 +28,8 @@ if __name__ == '__main__':
path = sys.argv[1]
port = int(sys.argv[2]) if len(sys.argv) > 2 else 8000
httpd = simple_server.make_server('', port, app)
- print "Serving %s on port %s" % (path, port)
- httpd.serve_forever()
+ print "Serving %s on port %s, control-C to stop" % (path, port)
+ try:
+ httpd.serve_forever()
+ except KeyboardInterrupt:
+ print "\b\bShutting down."