diff --git a/pex/environment.py b/pex/environment.py index 492e99edb..9f9c056c0 100644 --- a/pex/environment.py +++ b/pex/environment.py @@ -122,9 +122,12 @@ def __init__(self, pex, pex_info, interpreter=None, **kw): self._supported_tags = [] platform = Platform.current() + platform_name = platform.platform super(PEXEnvironment, self).__init__( search_path=[] if pex_info.inherit_path == 'false' else sys.path, - platform=platform.platform, + # NB: Our pkg_resources.Environment base-class wants the platform name string and not the + # pex.platform.Platform object. + platform=platform_name, **kw ) self._supported_tags.extend(platform.supported_tags(self._interpreter)) diff --git a/pex/resolver.py b/pex/resolver.py index c2ac8aee4..68955807f 100644 --- a/pex/resolver.py +++ b/pex/resolver.py @@ -174,8 +174,9 @@ def _expand_and_maybe_adjust_platform(interpreter, platform=None): # IE: Say we're on OSX and platform was 'linux-x86_64' or 'linux_x86_64-cp-27-cp27mu'. return given_platform - ii = interpreter.identity - if (ii.abbr_impl, ii.impl_ver, ii.abi_tag) == (cur_plat.impl, cur_plat.version, cur_plat.abi): + if (interpreter.identity.abbr_impl, + interpreter.identity.impl_ver, + interpreter.identity.abi_tag) == (cur_plat.impl, cur_plat.version, cur_plat.abi): # IE: Say we're on Linux and platform was 'current' or 'linux-x86_64' or # 'linux_x86_64-cp-27-cp27mu'and the current extended platform info matches the given # interpreter exactly. @@ -184,9 +185,9 @@ def _expand_and_maybe_adjust_platform(interpreter, platform=None): # Otherwise we need to adjust the platform to match a local interpreter different from the # currently executing interpreter. adjusted_platform = Platform(platform=cur_plat.platform, - impl=ii.abbr_impl, - version=ii.impl_ver, - abi=ii.abi_tag) + impl=interpreter.identity.abbr_impl, + version=interpreter.identity.impl_ver, + abi=interpreter.identity.abi_tag) TRACER.log(""" Modifying given platform of {given_platform!r}: