Commits

Benjamin Peterson committed 8b384de

generally, sockets should be closed after they're used

  • Participants
  • Parent commits f13c06b
  • Branches 3.1

Comments (0)

Files changed (1)

File Lib/socketserver.py

         else:
             # Child process.
             # This must never return, hence os._exit()!
-            self.socket.close()
             try:
                 self.finish_request(request, client_address)
+                self.socket.close()
                 os._exit(0)
             except:
                 try:
                     self.handle_error(request, client_address)
+                    self.socket.close()
                 finally:
                     os._exit(1)