Commit 9962c0af authored by Jason R. Coombs's avatar Jason R. Coombs

Extract function for ensure_local_distuils

parent 4ac101a1
......@@ -21,9 +21,11 @@ def patch_sys_path():
sys.path[:] = orig
if 'distutils' in sys.path:
raise RuntimeError("Distutils must not be imported before setuptools")
def ensure_local_distutils():
if 'distutils' in sys.path:
raise RuntimeError("Distutils must not be imported before setuptools")
with patch_sys_path():
importlib.import_module('distutils')
with patch_sys_path():
importlib.import_module('distutils')
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