summaryrefslogtreecommitdiffstats
path: root/Lib/socketserver.py
diff options
context:
space:
mode:
authorKristján Valur Jónsson <kristjan@ccpgames.com>2009-07-04 15:09:25 (GMT)
committerKristján Valur Jónsson <kristjan@ccpgames.com>2009-07-04 15:09:25 (GMT)
commit8c4f4178cbd22b49c19f56baa0b305cbb64b9e94 (patch)
tree516713e2c2ac59691d26bac2a20f1fb3708c9efa /Lib/socketserver.py
parent04cecafce10abc8906a96aa16c0a7a87d9fb8227 (diff)
downloadcpython-8c4f4178cbd22b49c19f56baa0b305cbb64b9e94.zip
cpython-8c4f4178cbd22b49c19f56baa0b305cbb64b9e94.tar.gz
cpython-8c4f4178cbd22b49c19f56baa0b305cbb64b9e94.tar.bz2
http://bugs.python.org/issue6381
merging revision 73819 from trunk
Diffstat (limited to 'Lib/socketserver.py')
-rw-r--r--Lib/socketserver.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/socketserver.py b/Lib/socketserver.py
index e5f5778..37df2ba 100644
--- a/Lib/socketserver.py
+++ b/Lib/socketserver.py
@@ -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()