Skip to content

Commit ebee1ce

Browse files
matpdegroote2pradyunsg
authored andcommitted
Improve error message when egg-link does not match installed location
Include the locations of the mismatched locations in the message, to provide more context.
1 parent 98d9fdf commit ebee1ce

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/pip/_internal/req/req_uninstall.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -530,10 +530,11 @@ def from_dist(cls, dist: Distribution) -> "UninstallPathSet":
530530
# develop egg
531531
with open(develop_egg_link) as fh:
532532
link_pointer = os.path.normcase(fh.readline().strip())
533-
assert (
534-
link_pointer == dist.location
535-
), "Egg-link {} does not match installed location of {} (at {})".format(
536-
link_pointer, dist.project_name, dist.location
533+
assert link_pointer == dist.location, (
534+
"Egg-link located at {} and pointing to {} does not match "
535+
"installed location of {} at {}".format(
536+
develop_egg_link, link_pointer, dist.project_name, dist.location
537+
)
537538
)
538539
paths_to_remove.add(develop_egg_link)
539540
easy_install_pth = os.path.join(

0 commit comments

Comments
 (0)