Merged revisions 81587 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81587 | r.david.murray | 2010-05-28 14:17:20 -0400 (Fri, 28 May 2010) | 2 lines

  Make the ctl-C shutdown of serve.py prettier.
........
This commit is contained in:
R. David Murray 2010-05-31 23:23:50 +00:00
parent 1790bc43bf
commit 5ab2e74036
1 changed files with 5 additions and 2 deletions

View File

@ -28,5 +28,8 @@ if __name__ == '__main__':
path = sys.argv[1] path = sys.argv[1]
port = int(sys.argv[2]) if len(sys.argv) > 2 else 8000 port = int(sys.argv[2]) if len(sys.argv) > 2 else 8000
httpd = simple_server.make_server('', port, app) httpd = simple_server.make_server('', port, app)
print("Serving {} on port {}".format(path, port)) print("Serving {} on port {}, control-C to stop".format(path, port))
httpd.serve_forever() try:
httpd.serve_forever()
except KeyboardInterrupt:
print("\b\bShutting down.")