Skip to content

Commit 1965578

Browse files
authored
Merge pull request pypa/distutils#348 from Avasam/old-sys.version_info
Remove Python 3.7 code paths
2 parents fd45200 + 8c65914 commit 1965578

File tree

2 files changed

+2
-20
lines changed

2 files changed

+2
-20
lines changed

distutils/command/install.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def _resolve_scheme(name):
144144
try:
145145
resolved = sysconfig.get_preferred_scheme(key)
146146
except Exception:
147-
resolved = fw.scheme(_pypy_hack(name))
147+
resolved = fw.scheme(name)
148148
return resolved
149149

150150

@@ -161,7 +161,7 @@ def _inject_headers(name, scheme):
161161
"""
162162
# Bypass the preferred scheme, which may not
163163
# have defined headers.
164-
fallback = _load_scheme(_pypy_hack(name))
164+
fallback = _load_scheme(name)
165165
scheme.setdefault('headers', fallback['headers'])
166166
return scheme
167167

@@ -171,14 +171,6 @@ def _scheme_attrs(scheme):
171171
return {f'install_{key}': scheme[key] for key in SCHEME_KEYS}
172172

173173

174-
def _pypy_hack(name):
175-
PY37 = sys.version_info < (3, 8)
176-
old_pypy = hasattr(sys, 'pypy_version_info') and PY37
177-
prefix = not name.endswith(('_user', '_home'))
178-
pypy_name = 'pypy' + '_nt' * (os.name == 'nt')
179-
return pypy_name if old_pypy and prefix else name
180-
181-
182174
class install(Command):
183175
description = "install everything from build directory"
184176

distutils/sysconfig.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,6 @@ def _extant(path):
156156

157157

158158
def _get_python_inc_posix(prefix, spec_prefix, plat_specific):
159-
if IS_PYPY and sys.version_info < (3, 8):
160-
return os.path.join(prefix, 'include')
161159
return (
162160
_get_python_inc_posix_python(plat_specific)
163161
or _extant(_get_python_inc_from_config(plat_specific, spec_prefix))
@@ -246,14 +244,6 @@ def get_python_lib(
246244
sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
247245
"""
248246

249-
if IS_PYPY and sys.version_info < (3, 8):
250-
# PyPy-specific schema
251-
if prefix is None:
252-
prefix = PREFIX
253-
if standard_lib:
254-
return os.path.join(prefix, "lib-python", sys.version_info.major)
255-
return os.path.join(prefix, 'site-packages')
256-
257247
early_prefix = prefix
258248

259249
if prefix is None:

0 commit comments

Comments
 (0)