title: can't close socket on KeyboardInterrupt
body: <pre><code>from socket import socket, AF_INET, SOCK_STREAM
  
  sock = socket(AF_INET, SOCK_STREAM)
  sock.bind(("localhost", 7777))
  sock.listen(1)
  while True:
      try:
          connection, address = sock.accept()
          print("connected from " + address)
          received_message = sock.recv(300)
          if not received_message:
              break
          connection.sendall(b"hello")
  
      except KeyBoardInterrupt:
          connection.close()
  </code></pre>
  
  <p>so Im trying to wrap my head around sockets and have this pretty simple script 
  but for some reason I can't kill this script with a <code>KeyboardInterrupt</code></p>
  
  <p>how do I do kill the script with a <code>KeyboardInterrupt</code>  that and why can't I kill it with a <code>KeyboardInterrupt</code>?</p>