#NEWLINE# def readElement( self ) : #NEWLINE# #INDENT# '\n        Reads an AMF3 element from the data stream.\n\n        @raise DecodeError: The ActionScript type is unsupported.\n        @raise EOStream: No more data left to decode.\n        ' #NEWLINE# pos = self . stream . tell ( ) #NEWLINE# try : #NEWLINE# #INDENT# t = self . stream . read ( 1 ) #NEWLINE# #UNINDENT# except IOError : #NEWLINE# #INDENT# raise pyamf . EOStream #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# func = self . _func_cache [ t ] #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# func = self . getTypeFunc ( t ) #NEWLINE# if ( not func ) : #NEWLINE# #INDENT# raise pyamf . DecodeError ( ( 'Unsupported ActionScript type %s' % ( hex ( ord ( t ) ) , ) ) ) #NEWLINE# #UNINDENT# self . _func_cache [ t ] = func #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# return func ( ) #NEWLINE# #UNINDENT# except IOError : #NEWLINE# #INDENT# self . stream . seek ( pos ) #NEWLINE# raise