mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
listen: handle KeyboardInterrupt
Current response to Ctrl+C with "pelican --listen" is to bail with an exception. Instead, exit proper and show a message. Fixes #2676
This commit is contained in:
parent
70c8d2a474
commit
e23af21b21
1 changed files with 3 additions and 0 deletions
|
|
@ -474,6 +474,9 @@ def listen(server, port, output, excqueue=None):
|
|||
excqueue.put(traceback.format_exception_only(type(e), e)[-1])
|
||||
return
|
||||
|
||||
except KeyboardInterrupt:
|
||||
logger.info("Shutting down server.")
|
||||
httpd.socket.close()
|
||||
|
||||
def main(argv=None):
|
||||
args = parse_arguments(argv)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue