Clearing out old patch queue. Patch #558547, make SocketServer more
authorAnthony Baxter <anthonybaxter@gmail.com>
Thu, 2 Jan 2003 03:07:48 +0000 (03:07 +0000)
committerAnthony Baxter <anthonybaxter@gmail.com>
Thu, 2 Jan 2003 03:07:48 +0000 (03:07 +0000)
robust. This makes socketserver's close() method callable repeatedly
without error - similar to other file-like objects.

Lib/SocketServer.py

index 4437581dca13f1b2024959c8064a6791cc2d30a0..270f4cd69d932b27dd702a1872889468509902da 100644 (file)
@@ -561,7 +561,8 @@ class StreamRequestHandler(BaseRequestHandler):
         self.wfile = self.connection.makefile('wb', self.wbufsize)
 
     def finish(self):
-        self.wfile.flush()
+        if not self.wfile.closed:
+            self.wfile.flush()
         self.wfile.close()
         self.rfile.close()