

def _websocket_safe_read(self):
    "Returns data if available, otherwise ''. Newlines indicate multiple messages "
    data = ''
    while True:
        try:
            data += '{0}\n'.format(self._websocket.recv())
        except:
            return data.rstrip()

dataset/ETHPy150Open lins05/slackbot/tests/functional/driver.py Driver._websocket_safe_read/original