MCPcopy Index your code
hub / github.com/python/cpython / _expand_vars

Function _expand_vars

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

Source from the content-addressed store, hash-verified

258
259
260def _expand_vars(scheme, vars):
261 res = {}
262 if vars is None:
263 vars = {}
264 _extend_dict(vars, get_config_vars())
265 if os.name == 'nt':
266 # On Windows we want to substitute 'lib' for schemes rather
267 # than the native value (without modifying vars, in case it
268 # was passed in)
269 vars = vars | {'platlibdir': 'lib'}
270
271 for key, value in _INSTALL_SCHEMES[scheme].items():
272 if os.name in ('posix', 'nt'):
273 value = os.path.expanduser(value)
274 res[key] = os.path.normpath(_subst_vars(value, vars))
275 return res
276
277
278def _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

Used in the wild real call sites across dependent graphs

searching dependent graphs…