Skip to content

Commit

Permalink
Add fallback support for distutils in stdlib.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Dec 20, 2021
1 parent 76c9ab9 commit 60b7846
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions setuptools/command/easy_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,13 @@ def finalize_options(self): # noqa: C901 # is too complex (25) # FIXME
# Only python 3.2+ has abiflags
'abiflags': getattr(sys, 'abiflags', ''),
'platlibdir': getattr(sys, 'platlibdir', 'lib'),
'implementation_lower': install._get_implementation().lower(),
'implementation': install._get_implementation(),
}
with contextlib.suppress(AttributeError):
# only for distutils outside stdlib
self.config_vars.update({
'implementation_lower': install._get_implementation().lower(),
'implementation': install._get_implementation(),
})

if site.ENABLE_USER_SITE:
self.config_vars['userbase'] = self.install_userbase
Expand Down Expand Up @@ -714,7 +718,11 @@ def install_item(self, spec, download, tmpdir, deps, install_needed=False):
return dist

def select_scheme(self, name):
install._select_scheme(self, name)
try:
install._select_scheme(self, name)
except AttributeError:
# stdlib distutils
install.install.select_scheme(self, name)

# FIXME: 'easy_install.process_distribution' is too complex (12)
def process_distribution( # noqa: C901
Expand Down

0 comments on commit 60b7846

Please sign in to comment.