#NEWLINE# def my_import( name ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# imp = __import__ ( name ) #NEWLINE# #UNINDENT# except ImportError as err : #NEWLINE# #INDENT# raise JobError ( ( 'Failed to import %s with error %s' % ( name , err ) ) ) #NEWLINE# #UNINDENT# mods = name . split ( '.' ) #NEWLINE# if ( len ( mods ) > 1 ) : #NEWLINE# #INDENT# for mod in mods [ 1 : ] : #NEWLINE# #INDENT# imp = getattr ( imp , mod ) #NEWLINE# #UNINDENT# #UNINDENT# return imp