]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
http://bugs.python.org/issue6381
authorKristján Valur Jónsson <kristjan@ccpgames.com>
Sat, 4 Jul 2009 15:18:00 +0000 (15:18 +0000)
committerKristján Valur Jónsson <kristjan@ccpgames.com>
Sat, 4 Jul 2009 15:18:00 +0000 (15:18 +0000)
merging revision 73819 from trunk

Lib/socketserver.py

index e5f5778872fe96ea526240c3b25bf415f13aae80..37df2bab33c76defea38af64bf9ecf65b17f4c35 100644 (file)
@@ -445,7 +445,12 @@ class TCPServer(BaseServer):
 
     def close_request(self, request):
         """Called to clean up an individual request."""
-        request.shutdown(socket.SHUT_WR)
+        try:
+            #explicitly shutdown.  socket.close() merely releases
+            #the socket and waits for GC to perform the actual close.
+            request.shutdown(socket.SHUT_WR)
+        except socket.error:
+            pass #some platforms may raise ENOTCONN here
         request.close()