diff options
author | fauxpark <fauxpark@gmail.com> | 2019-10-12 15:41:58 +1100 |
---|---|---|
committer | Drashna Jaelre <drashna@live.com> | 2019-10-11 21:41:58 -0700 |
commit | 076d8babbbd762f9a316a26144d966238b9b71cc (patch) | |
tree | b97aba04c69672a86ffce1c464599baa710a47ea /lib/python/qmk/cli/docs.py | |
parent | c54d2cbe02f1c9c1743aa4d68ed3451a2398eab1 (diff) | |
download | qmk_firmware-076d8babbbd762f9a316a26144d966238b9b71cc.tar.gz qmk_firmware-076d8babbbd762f9a316a26144d966238b9b71cc.zip |
[CLI] `qmk docs` graceful shutdown on Ctrl+C (#6989)
Diffstat (limited to 'lib/python/qmk/cli/docs.py')
-rw-r--r-- | lib/python/qmk/cli/docs.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/python/qmk/cli/docs.py b/lib/python/qmk/cli/docs.py index a0888ec388..b419891396 100644 --- a/lib/python/qmk/cli/docs.py +++ b/lib/python/qmk/cli/docs.py @@ -19,4 +19,9 @@ def docs(cli): cli.log.info("Serving QMK docs at http://localhost:%d/", cli.config.docs.port) cli.log.info("Press Control+C to exit.") - httpd.serve_forever() + try: + httpd.serve_forever() + except KeyboardInterrupt: + cli.log.info("Stopping HTTP server...") + finally: + httpd.shutdown() |