#NEWLINE# def maybe_reexec_pex( ) : #NEWLINE# #INDENT# from . variables import ENV #NEWLINE# if ( not ENV . PEX_PYTHON ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# from . common import die #NEWLINE# from . tracer import TRACER #NEWLINE# target_python = ENV . PEX_PYTHON #NEWLINE# target = find_in_path ( target_python ) #NEWLINE# if ( not target ) : #NEWLINE# #INDENT# die ( ( 'Failed to find interpreter specified by PEX_PYTHON: %s' % target ) ) #NEWLINE# #UNINDENT# if ( os . path . exists ( target ) and ( os . path . realpath ( target ) != os . path . realpath ( sys . executable ) ) ) : #NEWLINE# #INDENT# TRACER . log ( ( 'Detected PEX_PYTHON, re-exec to %s' % target ) ) #NEWLINE# ENV . delete ( 'PEX_PYTHON' ) #NEWLINE# os . execve ( target , ( [ target_python ] + sys . argv ) , ENV . copy ( ) )