mirror of
https://github.com/python/cpython.git
synced 2024-11-25 02:44:06 +08:00
Merge with 3.3
Issue #14574: Ignore socket errors raised when flushing a connection on close.
This commit is contained in:
commit
cacb400345
@ -313,8 +313,8 @@ request.
|
||||
.. method:: RequestHandler.finish()
|
||||
|
||||
Called after the :meth:`handle` method to perform any clean-up actions
|
||||
required. The default implementation does nothing. If :meth:`setup` or
|
||||
:meth:`handle` raise an exception, this function will not be called.
|
||||
required. The default implementation does nothing. If :meth:`setup`
|
||||
raises an exception, this function will not be called.
|
||||
|
||||
|
||||
.. method:: RequestHandler.handle()
|
||||
|
@ -718,7 +718,12 @@ class StreamRequestHandler(BaseRequestHandler):
|
||||
|
||||
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()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user