diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2021-12-20 12:01:37 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2021-12-20 12:01:37 -0500 |
commit | 60b78468341d52bc033f0ad77e890a656ccb9a72 (patch) | |
tree | ed91efddcb05ae69226ae46bc4565dd834b716bc /setuptools/command/easy_install.py | |
parent | 76c9ab9efc3f13e5ef8681614bebbe437bf51012 (diff) | |
download | python-setuptools-git-60b78468341d52bc033f0ad77e890a656ccb9a72.tar.gz |
Add fallback support for distutils in stdlib.
Diffstat (limited to 'setuptools/command/easy_install.py')
-rw-r--r-- | setuptools/command/easy_install.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 00b59904..e8150057 100644 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -252,9 +252,13 @@ class easy_install(Command): # 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 @@ -714,7 +718,11 @@ class easy_install(Command): 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 |