]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/blobdiff - setuptools-0.6c16dev3.egg/pkg_resources.py
pkg_resources: better error message on bad spec
[tahoe-lafs/tahoe-lafs.git] / setuptools-0.6c16dev3.egg / pkg_resources.py
index 00d97225de29b13d793877b2e3e6398ff25d0b05..3dbdec14dc385ba35cd3ce41214b2850e19c989f 100644 (file)
@@ -528,11 +528,14 @@ class WorkingSet(object):
         # dist is unsatisfactory, in which case we won't add it.
         if __requires__ is not None:
             for thisreqstr in __requires__:
-                for thisreq in parse_requirements(thisreqstr):
-                    if thisreq.key == dist.key:
-                        if dist not in thisreq:
-                            return
-
+                try:
+                    for thisreq in parse_requirements(thisreqstr):
+                        if thisreq.key == dist.key:
+                            if dist not in thisreq:
+                                return
+                except ValueError, e:
+                    e.args = tuple(e.args + ({'thisreqstr': thisreqstr},))
+                    raise
 
         self.by_key[dist.key] = dist
         if dist.key not in keys: