aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xserve.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/serve.py b/serve.py
index 2958968..be8c047 100755
--- a/serve.py
+++ b/serve.py
@@ -78,4 +78,8 @@ if __name__ == '__main__':
with HTTPServer((args.address, args.port), Handler) as httpd:
print('GSX mock server serving on http://%s:%d' % (args.address, args.port))
- httpd.serve_forever()
+ try:
+ httpd.serve_forever()
+ except KeyboardInterrupt:
+ print('GSX mock server shutting down...')
+ httpd.shutdown()