def safe_finish(self):
        """Finish session. If it will blow up - connection was set to Keep-Alive and
        client dropped connection, ignore any IOError or socket error."""
        try:
            self.finish()
        except (socket.error, __HOLE__):
            # We don't want to raise IOError exception if finish() call fails.
            # It can happen if connection is set to Keep-Alive, but client
            # closes connection after receiving response.
            logging.debug('Ignoring IOError in safe_finish()')
            pass
dataset/ETHPy150Open benoitc/gaffer/gaffer/sockjs/basehandler.py/BaseHandler.safe_finish