#NEWLINE# def copy_required_modules( dst_prefix , symlink ) : #NEWLINE# #INDENT# import imp #NEWLINE# _prev_sys_path = sys . path #NEWLINE# if os . environ . get ( 'VIRTUALENV_INTERPRETER_RUNNING' ) : #NEWLINE# #INDENT# sys . path = sys . path [ 1 : ] #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# for modname in REQUIRED_MODULES : #NEWLINE# #INDENT# if ( modname in sys . builtin_module_names ) : #NEWLINE# #INDENT# logger . info ( ( 'Ignoring built-in bootstrap module: %s' % modname ) ) #NEWLINE# continue #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# ( f , filename , _ ) = imp . find_module ( modname ) #NEWLINE# #UNINDENT# except ImportError : #NEWLINE# #INDENT# logger . info ( ( 'Cannot import bootstrap module: %s' % modname ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( f is not None ) : #NEWLINE# #INDENT# f . close ( ) #NEWLINE# #UNINDENT# if ( ( modname == 'readline' ) and ( sys . platform == 'darwin' ) and ( not ( is_pypy or filename . endswith ( join ( 'lib-dynload' , 'readline.so' ) ) ) ) ) : #NEWLINE# #INDENT# dst_filename = join ( dst_prefix , 'lib' , ( 'python%s' % sys . version [ : 3 ] ) , 'readline.so' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( modname == 'readline' ) and ( sys . platform == 'win32' ) ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# dst_filename = change_prefix ( filename , dst_prefix ) #NEWLINE# #UNINDENT# #UNINDENT# copyfile ( filename , dst_filename , symlink ) #NEWLINE# if filename . endswith ( '.pyc' ) : #NEWLINE# #INDENT# pyfile = filename [ : ( - 1 ) ] #NEWLINE# if os . path . exists ( pyfile ) : #NEWLINE# #INDENT# copyfile ( pyfile , dst_filename [ : ( - 1 ) ] , symlink ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# finally : #NEWLINE# #INDENT# sys . path = _prev_sys_path