#NEWLINE# def find_python_name( self , name , mark ) : #NEWLINE# #INDENT# if ( not name ) : #NEWLINE# #INDENT# raise ConstructorError ( 'while constructing a Python object' , mark , 'expected non-empty name appended to the tag' , mark ) #NEWLINE# #UNINDENT# if ( '.' in name ) : #NEWLINE# #INDENT# ( module_name , object_name ) = name . rsplit ( '.' , 1 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# module_name = 'builtins' #NEWLINE# object_name = name #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# __import__ ( module_name ) #NEWLINE# #UNINDENT# except ImportError as exc : #NEWLINE# #INDENT# raise ConstructorError ( 'while constructing a Python object' , mark , ( 'cannot find module %r (%s)' % ( module_name , exc ) ) , mark ) #NEWLINE# #UNINDENT# module = sys . modules [ module_name ] #NEWLINE# if ( not hasattr ( module , object_name ) ) : #NEWLINE# #INDENT# raise ConstructorError ( 'while constructing a Python object' , mark , ( 'cannot find %r in the module %r' % ( object_name , module . __name__ ) ) , mark ) #NEWLINE# #UNINDENT# return getattr ( module , object_name )