def __env(envdir):
# http://stackoverflow.com/a/1883251
if hasattr(sys, 'real_prefix'):
# We're already inside someone else's virtualenv.
return sys.prefix
elif hasattr(sys, 'base_prefix') and sys.base_prefix != sys.prefix:
# We're already inside someone else's pyvenv.
return sys.prefix
elif os.path.exists(envdir):
# We've already built our own virtualenv.
return envdir
args = [sys.executable] + ENV_ARGS + [envdir]
run(*args)
return envdir
评论列表
文章目录