diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2021-09-21 20:53:59 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2021-09-21 20:53:59 -0400 |
commit | 044f77190bb457f35222044e5a455cfb11a4455e (patch) | |
tree | 3ed4ad70be58267a935865c4410cb54f260193ef | |
parent | dcafd577d3bc0a5a87e3278d976bea0ca4b43084 (diff) | |
download | python-setuptools-git-044f77190bb457f35222044e5a455cfb11a4455e.tar.gz |
Replace instance method with global function.
-rw-r--r-- | distutils/command/install.py | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/distutils/command/install.py b/distutils/command/install.py index 848388bb..026c609a 100644 --- a/distutils/command/install.py +++ b/distutils/command/install.py @@ -84,6 +84,22 @@ if HAS_USER_SITE: SCHEME_KEYS = ('purelib', 'platlib', 'headers', 'scripts', 'data') +def _load_schemes(): + """ + Extend default schemes with schemes from sysconfig. + """ + + schemes = dict(INSTALL_SCHEMES) + + try: + import sysconfig + schemes.update(sysconfig.INSTALL_SCHEMES) + except (ImportError, AttributeError): + pass + + return schemes + + class install(Command): description = "install everything from build directory" @@ -404,21 +420,6 @@ class install(Command): val = getattr(self, opt_name) log.debug(" %s: %s", opt_name, val) - def _load_schemes(self): - """ - Allow sysconfig to alter schemes. - """ - - schemes = dict(INSTALL_SCHEMES) - - try: - import sysconfig - schemes.update(sysconfig.INSTALL_SCHEMES) - except (ImportError, AttributeError): - pass - - return schemes - def finalize_unix(self): """Finalizes options for posix platforms.""" if self.install_base is not None or self.install_platbase is not None: @@ -490,7 +491,7 @@ class install(Command): name = 'pypy_nt' else: name = 'pypy' - scheme = self._load_schemes()[name] + scheme = _load_schemes()[name] for key in SCHEME_KEYS: attrname = 'install_' + key if getattr(self, attrname) is None: |