Skip to content

Commit f8d98eb

Browse files
committed
Allow to decide whether to use distutils or sysconfig with sysconfig._PIP_USE_SYSCONFIG
Fixes pypa#10647
1 parent 3534896 commit f8d98eb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/pip/_internal/locations/__init__.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@
4545

4646
_PLATLIBDIR: str = getattr(sys, "platlibdir", "lib")
4747

48-
_USE_SYSCONFIG = sys.version_info >= (3, 10)
48+
# By default, we use sysconfig on Python 3.10+
49+
# But Python distributors can override this decision by setting:
50+
# sysconfig._PIP_USE_SYSCONFIG = True / False
51+
# Rationale in https://github.com/pypa/pip/issues/10647
52+
_USE_SYSCONFIG = getattr(sysconfig, "_PIP_USE_SYSCONFIG", sys.version_info >= (3, 10))
4953

5054

5155
def _looks_like_bpo_44860() -> bool:

0 commit comments

Comments
 (0)