fix: Handle KeyboardInterrupt gracefully in server.py

This commit is contained in:
2025-10-31 09:59:48 +01:00
parent 9c6c619071
commit f889c4dc68

View File

@@ -22,4 +22,8 @@ class SystemInfoHandler(http.server.SimpleHTTPRequestHandler):
with socketserver.TCPServer(('', PORT), SystemInfoHandler) as httpd: with socketserver.TCPServer(('', PORT), SystemInfoHandler) as httpd:
print("serving at port", PORT) print("serving at port", PORT)
try:
httpd.serve_forever() httpd.serve_forever()
except KeyboardInterrupt:
print("\nShutting down server.")
httpd.shutdown()