MCPcopy Index your code
hub / github.com/ekalinin/nodeenv / get_env_dir

Function get_env_dir

nodeenv.py:1079–1094  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

1077
1078
1079def get_env_dir(args):
1080 if args.python_virtualenv:
1081 if hasattr(sys, 'real_prefix'):
1082 res = sys.prefix
1083 elif hasattr(sys, 'base_prefix') and sys.base_prefix != sys.prefix:
1084 res = sys.prefix
1085 elif 'CONDA_PREFIX' in os.environ:
1086 res = sys.prefix
1087 elif 'VIRTUAL_ENV' in os.environ:
1088 res = os.environ['VIRTUAL_ENV']
1089 else:
1090 logger.error('No python virtualenv is available')
1091 sys.exit(2)
1092 else:
1093 res = args.env_dir
1094 return to_utf8(res)
1095
1096
1097# noinspection PyProtectedMember

Callers 1

mainFunction · 0.85

Calls 1

to_utf8Function · 0.85

Tested by

no test coverage detected