#NEWLINE# def on_attribute( self , node ) : #NEWLINE# #INDENT# 'extract attribute' #NEWLINE# ctx = node . ctx . __class__ #NEWLINE# if ( ctx == ast . Del ) : #NEWLINE# #INDENT# return delattr ( fmt , node . attr ) #NEWLINE# #UNINDENT# sym = self . run ( node . value ) #NEWLINE# if ( node . attr not in UNSAFE_ATTRS ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# return getattr ( sym , node . attr ) #NEWLINE# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# obj = self . run ( node . value ) #NEWLINE# fmt = "%s does not have member '%s'" #NEWLINE# if ( not isgroup ( obj ) ) : #NEWLINE# #INDENT# obj = obj . __class__ #NEWLINE# fmt = "%s does not have attribute '%s'" #NEWLINE# #UNINDENT# msg = ( fmt % ( obj , node . attr ) ) #NEWLINE# self . raise_exception ( node , exc = AttributeError , msg = msg )