File tree 2 files changed +15
-0
lines changed
src/pip/_internal/locations
2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change
1
+ Ensure that things work correctly in environments where setuptools-injected
2
+ ``distutils `` is available by default. This is done by cooperating with
3
+ setuptools' injection logic to ensure that pip uses the ``distutils `` from the
4
+ Python standard library instead.
Original file line number Diff line number Diff line change 3
3
# The following comment should be removed at some point in the future.
4
4
# mypy: strict-optional=False
5
5
6
+ # If pip's going to use distutils, it should not be using the copy that setuptools
7
+ # might have injected into the environment. This is done by removing the injected
8
+ # shim, if it's injected.
9
+ #
10
+ # See https://github.com/pypa/pip/issues/8761 for the original discussion and
11
+ # rationale for why this is done within pip.
12
+ try :
13
+ __import__ ("_distutils_hack" ).remove_shim ()
14
+ except ImportError :
15
+ pass
16
+
6
17
import logging
7
18
import os
8
19
import sys
You can’t perform that action at this time.
0 commit comments