From 8c659145d699bcca201eb0f308471da199f3d616 Mon Sep 17 00:00:00 2001 From: Avasam Date: Wed, 19 Mar 2025 19:52:59 -0400 Subject: [PATCH] Remove Python 3.7 code paths --- distutils/command/install.py | 12 ++---------- distutils/sysconfig.py | 10 ---------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/distutils/command/install.py b/distutils/command/install.py index b09048cf..54bbdf6e 100644 --- a/distutils/command/install.py +++ b/distutils/command/install.py @@ -145,7 +145,7 @@ def _resolve_scheme(name): try: resolved = sysconfig.get_preferred_scheme(key) except Exception: - resolved = fw.scheme(_pypy_hack(name)) + resolved = fw.scheme(name) return resolved @@ -162,7 +162,7 @@ def _inject_headers(name, scheme): """ # Bypass the preferred scheme, which may not # have defined headers. - fallback = _load_scheme(_pypy_hack(name)) + fallback = _load_scheme(name) scheme.setdefault('headers', fallback['headers']) return scheme @@ -172,14 +172,6 @@ def _scheme_attrs(scheme): return {f'install_{key}': scheme[key] for key in SCHEME_KEYS} -def _pypy_hack(name): - PY37 = sys.version_info < (3, 8) - old_pypy = hasattr(sys, 'pypy_version_info') and PY37 - prefix = not name.endswith(('_user', '_home')) - pypy_name = 'pypy' + '_nt' * (os.name == 'nt') - return pypy_name if old_pypy and prefix else name - - class install(Command): description = "install everything from build directory" diff --git a/distutils/sysconfig.py b/distutils/sysconfig.py index e5facaec..7ddc869a 100644 --- a/distutils/sysconfig.py +++ b/distutils/sysconfig.py @@ -156,8 +156,6 @@ def _extant(path): def _get_python_inc_posix(prefix, spec_prefix, plat_specific): - if IS_PYPY and sys.version_info < (3, 8): - return os.path.join(prefix, 'include') return ( _get_python_inc_posix_python(plat_specific) or _extant(_get_python_inc_from_config(plat_specific, spec_prefix)) @@ -246,14 +244,6 @@ def get_python_lib( sys.base_exec_prefix -- i.e., ignore 'plat_specific'. """ - if IS_PYPY and sys.version_info < (3, 8): - # PyPy-specific schema - if prefix is None: - prefix = PREFIX - if standard_lib: - return os.path.join(prefix, "lib-python", sys.version_info.major) - return os.path.join(prefix, 'site-packages') - early_prefix = prefix if prefix is None: