#NEWLINE# def _lookup_template( context , uri , relativeto ) : #NEWLINE# #INDENT# lookup = context . _with_template . lookup #NEWLINE# if ( lookup is None ) : #NEWLINE# #INDENT# raise exceptions . TemplateLookupException ( ( "Template '%s' has no TemplateLookup associated" % context . _with_template . uri ) ) #NEWLINE# #UNINDENT# uri = lookup . adjust_uri ( uri , context ) #NEWLINE# try : #NEWLINE# #INDENT# return lookup . get_template ( uri ) #NEWLINE# #UNINDENT# except exceptions . TopLevelLookupException : #NEWLINE# #INDENT# raise exceptions . TemplateLookupException ( str ( compat . exception_as ( ) ) )