| 269 | |
| 270 | |
| 271 | def _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 | |
| 289 | def _get_preferred_schemes(): |