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 a0888ec38..b41989139 100644 --- a/lib/python/qmk/cli/docs.py +++ b/lib/python/qmk/cli/docs.py | |||
@@ -19,4 +19,9 @@ def docs(cli): | |||
19 | cli.log.info("Serving QMK docs at http://localhost:%d/", cli.config.docs.port) | 19 | cli.log.info("Serving QMK docs at http://localhost:%d/", cli.config.docs.port) |
20 | cli.log.info("Press Control+C to exit.") | 20 | cli.log.info("Press Control+C to exit.") |
21 | 21 | ||
22 | httpd.serve_forever() | 22 | try: |
23 | httpd.serve_forever() | ||
24 | except KeyboardInterrupt: | ||
25 | cli.log.info("Stopping HTTP server...") | ||
26 | finally: | ||
27 | httpd.shutdown() | ||