Skip to content

Commit

Permalink
Use more explicit variable names.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsirois committed Oct 3, 2018
1 parent cf1d0b1 commit c9f0618
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
5 changes: 4 additions & 1 deletion pex/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
11 changes: 6 additions & 5 deletions pex/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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}:
Expand Down

0 comments on commit c9f0618

Please sign in to comment.