Commit 67f0cc59 authored by Jason R. Coombs's avatar Jason R. Coombs

Provide escape hatch for distutils adoption.

parent cd8ac41d
......@@ -7,6 +7,7 @@ for more motivation.
import sys
import re
import os
import importlib
import warnings
......@@ -20,6 +21,13 @@ def clear_distutils():
del sys.modules[name]
def enabled():
"""
Provide an escape hatch for environments wishing to opt out.
"""
return 'SETUPTOOLS_DISTUTILS_ADOPTION_OPT_OUT' not in os.environ
def ensure_local_distutils():
clear_distutils()
distutils = importlib.import_module('setuptools._distutils')
......@@ -31,4 +39,5 @@ def ensure_local_distutils():
assert '_distutils' in core.__file__, core.__file__
ensure_local_distutils()
if enabled():
ensure_local_distutils()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment