summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPieter Degroote <pieter.degroote@materialise.be>2021-10-17 19:19:52 +0200
committerPradyun Gedam <pradyunsg@users.noreply.github.com>2021-10-22 10:07:03 +0100
commitebee1cecf8a27fea74c29fb9323ccca2d61bd4e3 (patch)
tree87358821dd7681633aa52c58e1f9e082b7675966
parent98d9fdfa09f4cfbbc35eea1a72e86e5fd954b57d (diff)
downloadpip-ebee1cecf8a27fea74c29fb9323ccca2d61bd4e3.tar.gz
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.
-rw-r--r--src/pip/_internal/req/req_uninstall.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/pip/_internal/req/req_uninstall.py b/src/pip/_internal/req/req_uninstall.py
index 779e93b44..b13501790 100644
--- a/src/pip/_internal/req/req_uninstall.py
+++ b/src/pip/_internal/req/req_uninstall.py
@@ -530,10 +530,11 @@ class UninstallPathSet:
# develop egg
with open(develop_egg_link) as fh:
link_pointer = os.path.normcase(fh.readline().strip())
- assert (
- link_pointer == dist.location
- ), "Egg-link {} does not match installed location of {} (at {})".format(
- link_pointer, dist.project_name, dist.location
+ assert link_pointer == dist.location, (
+ "Egg-link located at {} and pointing to {} does not match "
+ "installed location of {} at {}".format(
+ develop_egg_link, link_pointer, dist.project_name, dist.location
+ )
)
paths_to_remove.add(develop_egg_link)
easy_install_pth = os.path.join(