summaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
authorfauxpark <fauxpark@gmail.com>2019-10-12 15:41:58 +1100
committerDrashna Jaelre <drashna@live.com>2019-10-11 21:41:58 -0700
commit076d8babbbd762f9a316a26144d966238b9b71cc (patch)
treeb97aba04c69672a86ffce1c464599baa710a47ea /lib/python
parentc54d2cbe02f1c9c1743aa4d68ed3451a2398eab1 (diff)
[CLI] `qmk docs` graceful shutdown on Ctrl+C (#6989)
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/qmk/cli/docs.py7
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()