From a7cdb0f218b991f7d8c8f45af0e4f975673ee351 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Tue, 24 May 2011 12:06:31 -0500 Subject: generally, sockets should be closed after they're used --- Lib/socketserver.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/socketserver.py b/Lib/socketserver.py index 76ac50a..c53ac29 100644 --- a/Lib/socketserver.py +++ b/Lib/socketserver.py @@ -532,13 +532,14 @@ class ForkingMixIn: 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) -- cgit v0.12