#NEWLINE# def receive( self ) : #NEWLINE# #INDENT# '\n        Reads nonblocking characters from serial device up to bs characters\n        Returns empty bytes if no characters available else returns all available.\n        In canonical mode no chars are available until newline is entered.\n        ' #NEWLINE# data = b'' #NEWLINE# try : #NEWLINE# #INDENT# data = os . read ( self . fd , self . bs ) #NEWLINE# #UNINDENT# except OSError as ex1 : #NEWLINE# #INDENT# if ( ex1 . errno == errno . EAGAIN ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise #NEWLINE# #UNINDENT# #UNINDENT# return data