diff options
author | Filipp Lepalaan <filipp@mac.com> | 2018-10-09 18:06:54 +0300 |
---|---|---|
committer | Filipp Lepalaan <filipp@mac.com> | 2018-10-09 18:06:54 +0300 |
commit | 1c6b35652e8d71c5e22502f44df9079734a138bf (patch) | |
tree | eb926ada64e980ac169de430a8d7606e2129ee92 | |
parent | e6056c56316bb38eed69c366e346f1eeae979b9b (diff) | |
download | gsx-mockserver-1c6b35652e8d71c5e22502f44df9079734a138bf.tar.gz gsx-mockserver-1c6b35652e8d71c5e22502f44df9079734a138bf.tar.bz2 gsx-mockserver-1c6b35652e8d71c5e22502f44df9079734a138bf.zip |
Fix: add ctrl-c handler
-rwxr-xr-x | serve.py | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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() |