summaryrefslogtreecommitdiff
path: root/setuptools/distutils_patch.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2020-07-10 20:46:30 -0400
committerJason R. Coombs <jaraco@jaraco.com>2020-07-11 02:09:01 -0400
commitbedaf1309d2633831a7fb7dea561642e7da704df (patch)
tree866cc2ddac5a86e0686e62195c22fbaaeb1e98ec /setuptools/distutils_patch.py
parent67f0cc59f0d803f13c1da1cb60e87469f656617e (diff)
downloadpython-setuptools-git-distutils-adopt-escape-hatch.tar.gz
Allow opt-in and opt-out of distutils adoption at run time with SETUPTOOLS_USE_DISTUTILS environment variable.distutils-adopt-escape-hatch
Diffstat (limited to 'setuptools/distutils_patch.py')
-rw-r--r--setuptools/distutils_patch.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/setuptools/distutils_patch.py b/setuptools/distutils_patch.py
index bd1b4997..c5f273dd 100644
--- a/setuptools/distutils_patch.py
+++ b/setuptools/distutils_patch.py
@@ -23,9 +23,10 @@ def clear_distutils():
def enabled():
"""
- Provide an escape hatch for environments wishing to opt out.
+ Allow selection of distutils by environment variable.
"""
- return 'SETUPTOOLS_DISTUTILS_ADOPTION_OPT_OUT' not in os.environ
+ which = os.environ.get('SETUPTOOLS_USE_DISTUTILS', 'stdlib')
+ return which == 'local'
def ensure_local_distutils():