diff Lib/SocketServer.py @ 81049:df51cb946d27 2.7

Issue #14574: Ignore socket errors raised when flushing a connection on close.
author Kristján Valur Jónsson <kristjan@ccpgames.com>
date Tue, 25 Dec 2012 22:46:32 +0000
parents 4298d6e79ecb
children
line wrap: on
line diff
--- a/Lib/SocketServer.py	Tue Dec 25 18:50:03 2012 +0200
+++ b/Lib/SocketServer.py	Tue Dec 25 22:46:32 2012 +0000
@@ -701,7 +701,12 @@
 
     def finish(self):
         if not self.wfile.closed:
-            self.wfile.flush()
+            try:
+                self.wfile.flush()
+            except socket.error:
+                # An final socket error may have occurred here, such as
+                # the local error ECONNABORTED.
+                pass
         self.wfile.close()
         self.rfile.close()