diff options
author | Kristján Valur Jónsson <kristjan@ccpgames.com> | 2009-07-04 15:18:00 +0000 |
---|---|---|
committer | Kristján Valur Jónsson <kristjan@ccpgames.com> | 2009-07-04 15:18:00 +0000 |
commit | 200cfd00abd31d40d3f9c4d61ec06b63f3f66170 (patch) | |
tree | b2f37a020a1daabeebb3130d705d3b007624d3ab /Lib/socketserver.py | |
parent | b8e138aa238e23e9b3e53e012cd4e0b54ec28022 (diff) | |
download | cpython-git-200cfd00abd31d40d3f9c4d61ec06b63f3f66170.tar.gz |
http://bugs.python.org/issue6381
merging revision 73819 from trunk
Diffstat (limited to 'Lib/socketserver.py')
-rw-r--r-- | Lib/socketserver.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/socketserver.py b/Lib/socketserver.py index e5f5778872..37df2bab33 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() |