def run_setup(setup_script, args):
setup_dir = os.path.abspath(os.path.dirname(setup_script))<EOL>with setup_context(setup_dir):<EOL><INDENT>try:<EOL><INDENT>sys.argv[:] = [setup_script]+list(args)<EOL>sys.path.insert(<NUM_LIT:0>, setup_dir)<EOL>working_set.__init__()<EOL>working_set.callbacks.append(lambda dist:dist.activate())<EOL>def runner():<EOL><INDENT>ns = dict(__file__=setup_script, __name__='<STR_LIT:__main__>')<EOL>_execfile(setup_script, ns)<EOL><DEDENT>DirectorySandbox(setup_dir).run(runner)<EOL><DEDENT>except SystemExit as v:<EOL><INDENT>if v.args and v.args[<NUM_LIT:0>]:<EOL><INDENT>raise<EOL><DEDENT><DEDENT><DEDENT>
Run a distutils setup script, sandboxed in its directory