def stop(self):
        """ Stop recording S3Log messages (and return the messages) """

        handler = self.handler
        if handler != None:

            logger = logging.getLogger(__name__)
            logger.removeHandler(handler)

            handler.close()
            self.handler = None

        strbuf = self.strbuf
        if strbuf is not None:
            return strbuf.getvalue()
        else:
            return ""

    # -------------------------------------------------------------------------
dataset/ETHPy150Open sahana/eden/modules/s3log.py/S3LogRecorder.stop/operator `is not` -> `!=`