aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortarek <none@none>2009-11-14 20:01:49 +0100
committertarek <none@none>2009-11-14 20:01:49 +0100
commit4f06b3cc70d5a1457c0a158b3a2f1be1c4ea851c (patch)
treeff5bdd3a6854b9cdc691b54d9091f1ab55196307
parenta5319bc62245b80ed702f73519ac2c27805c3acf (diff)
downloadexternal_python_setuptools-4f06b3cc70d5a1457c0a158b3a2f1be1c4ea851c.tar.gz
external_python_setuptools-4f06b3cc70d5a1457c0a158b3a2f1be1c4ea851c.tar.bz2
external_python_setuptools-4f06b3cc70d5a1457c0a158b3a2f1be1c4ea851c.zip
nicer message when DistributionNotFound is raised
--HG-- branch : distribute extra : rebase_source : b25209fbcd33b497cb92ed7d8f442403c4eaf152
-rw-r--r--CHANGES.txt1
-rw-r--r--pkg_resources.py4
2 files changed, 4 insertions, 1 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 4e7ce3e3..f3072470 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -11,6 +11,7 @@ CHANGES
Initial Patch by arfrever.
* Issue 89: added a side bar with a download link to the doc.
* Issue 86: fixed missing sentence in pkg_resources doc.
+* Added a nicer error message when a DistributionNotFound is raised.
-----
0.6.8
diff --git a/pkg_resources.py b/pkg_resources.py
index 96381932..4975680d 100644
--- a/pkg_resources.py
+++ b/pkg_resources.py
@@ -528,7 +528,9 @@ class WorkingSet(object):
env = Environment(self.entries)
dist = best[req.key] = env.best_match(req, self, installer)
if dist is None:
- raise DistributionNotFound(req) # XXX put more info here
+ msg = ("The '%s' distribution was not found on this "
+ "system, and is required by this application.")
+ raise DistributionNotFound(msg % req)
to_activate.append(dist)
if dist not in req:
# Oops, the "best" so far conflicts with a dependency