Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions distutils/command/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def _get_implementation():


def _select_scheme(ob, name):
scheme = _inject_headers(name, _load_scheme(_resolve_scheme(name)))
scheme = _inject_headers(name, _load_scheme(_resolve_scheme(ob, name)))
vars(ob).update(_remove_set(ob, _scheme_attrs(scheme)))


Expand All @@ -139,10 +139,12 @@ def _remove_set(ob, attrs):
return {key: value for key, value in attrs.items() if getattr(ob, key) is None}


def _resolve_scheme(name):
def _resolve_scheme(ob, name):
os_name, sep, key = name.partition('_')
try:
resolved = sysconfig.get_preferred_scheme(key)
if resolved == 'posix_local' and ob.prefix is not None:
resolved = 'posix_prefix'
except Exception:
resolved = fw.scheme(name)
return resolved
Expand Down