diff options
author | R. David Murray <rdmurray@bitdance.com> | 2010-05-28 18:17:20 (GMT) |
---|---|---|
committer | R. David Murray <rdmurray@bitdance.com> | 2010-05-28 18:17:20 (GMT) |
commit | cbd7d3dbf2c1dc66411d9bcebbd8c6dbca2e41e4 (patch) | |
tree | 9a45cb5df850bd8850b5f8f46f752b344f07f9a6 /Tools | |
parent | e5d1c052166d0a6cbb087f21c1bba5184019bfd6 (diff) | |
download | cpython-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-x | Tools/scripts/serve.py | 7 |
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." |