1
0
Fork 0
forked from github/pelican

Tell users they can use CTRL-C to stop web server

This knowledge was heretofore assumed but is better made explicit.
This commit is contained in:
Justin Mayer 2020-01-17 15:11:42 +01:00
commit 569f8a080e

View file

@ -466,8 +466,9 @@ def listen(server, port, output, excqueue=None):
excqueue.put(traceback.format_exception_only(type(e), e)[-1]) excqueue.put(traceback.format_exception_only(type(e), e)[-1])
return return
logging.info("Serving at port %s, server %s.", port, server)
try: try:
print("\nServing site at: {}:{} - Tap CTRL-C to stop".format(
server, port))
httpd.serve_forever() httpd.serve_forever()
except Exception as e: except Exception as e:
if excqueue is not None: if excqueue is not None: