def finish_response(self):
# If the browser closes the connection while we still want to sen stuff back,
# we want to fail silently and give up. This often happens in tests where the
# browser may want to request embedded links (like stylesheets) too, yet the
# test has already clicked on the next link.
if six.PY3:
ssl_eof_error = ssl.SSLEOFError
broken_pipe_error = BrokenPipeError
else:
ssl_eof_error = ssl.SSLError
broken_pipe_error = socket.error
try:
ServerHandler.finish_response(self)
except (ssl_eof_error, broken_pipe_error):
# Silently ignore it if it looks like the client browser closed the connection.
pass
评论列表
文章目录