def _environ_from_activate(activate_script, tmpdir):
activate_file = tmpdir.join('environ-from-activate') + \
get_wrapper_extension()
activate_file.write('''%s
python -c "from os import environ; print(dict(environ))"
''' % activate_script)
activate_file.chmod(activate_file.stat().mode | stat.S_IXUSR)
output = subprocess.check_output(str(activate_file))
environ_from_activate = eval(output)
return environ_from_activate
评论列表
文章目录