#NEWLINE# def websocket_safe_read( self ) : #NEWLINE# #INDENT# " Returns data if available, otherwise ''. Newlines indicate multiple\n            messages\n        " #NEWLINE# data = '' #NEWLINE# while True : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# data += '{0}\n' . format ( self . websocket . recv ( ) ) #NEWLINE# #UNINDENT# except SSLError as e : #NEWLINE# #INDENT# if ( e . errno == 2 ) : #NEWLINE# #INDENT# return '' #NEWLINE# #UNINDENT# raise #NEWLINE# #UNINDENT# return data . rstrip ( )