Skip to content

Commit 0c9eb96

Browse files
bdrosen96sbidoul
authored andcommitted
Ensure that removing shim in older setuptools does not error
1 parent 61bdbe0 commit 0c9eb96

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)