Skip to content

Commit 74f850d

Browse files
authored
Merge pull request #11315 from bdrosen96/brett/fix_pip_attribute
2 parents 4fd08e1 + 50eb337 commit 74f850d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

news/11314.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Avoid ``AttributeError`` when removing the setuptools-provided ``_distutils_hack`` and it is missing its implementation.

src/pip/_internal/locations/_distutils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# rationale for why this is done within pip.
1212
try:
1313
__import__("_distutils_hack").remove_shim()
14-
except ImportError:
14+
except (ImportError, AttributeError):
1515
pass
1616

1717
import logging

0 commit comments

Comments
 (0)