MCPcopy Index your code
hub / github.com/RustPython/RustPython / _expand_vars

Function _expand_vars

Lib/sysconfig/__init__.py:271–286  ·  view source on GitHub ↗
(scheme, vars)

Source from the content-addressed store, hash-verified

269
270
271def _expand_vars(scheme, vars):
272 res = {}
273 if vars is None:
274 vars = {}
275 _extend_dict(vars, get_config_vars())
276 if os.name == 'nt':
277 # On Windows we want to substitute 'lib' for schemes rather
278 # than the native value (without modifying vars, in case it
279 # was passed in)
280 vars = vars | {'platlibdir': 'lib'}
281
282 for key, value in _INSTALL_SCHEMES[scheme].items():
283 if os.name in ('posix', 'nt'):
284 value = os.path.expanduser(value)
285 res[key] = os.path.normpath(_subst_vars(value, vars))
286 return res
287
288
289def _get_preferred_schemes():

Callers 2

test_get_pathsMethod · 0.90
get_pathsFunction · 0.85

Calls 5

_extend_dictFunction · 0.85
get_config_varsFunction · 0.85
_subst_varsFunction · 0.85
expanduserMethod · 0.80
itemsMethod · 0.45

Tested by 1

test_get_pathsMethod · 0.72