Raise a PackageNotFound exception instead of a ValueError
authorZac Medico <zmedico@gentoo.org>
Thu, 11 Oct 2007 05:19:14 +0000 (05:19 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 11 Oct 2007 05:19:14 +0000 (05:19 -0000)
in order to avoid ambiguity if an unexpected ValueError
occurs.

svn path=/main/trunk/; revision=8043

pym/emerge/__init__.py

index 2cbe1898712a6977c108d3f583b6e7a634d13243..e681fd23116e452b40b8451fcccf24bb168f0008 100644 (file)
@@ -2083,7 +2083,7 @@ class depgraph(object):
 
                                if not matched_packages:
                                        if raise_on_missing:
-                                               raise ValueError
+                                               raise portage.exception.PackageNotFound(x)
                                        if not arg:
                                                xinfo='"'+x+'"'
                                        else:
@@ -2820,7 +2820,7 @@ class depgraph(object):
                                        self.target_root, mydep, raise_on_missing=True, arg=mydep):
                                        print >> sys.stderr, "\n\n!!! Problem resolving dependencies for", mydep
                                        return 0
-                       except ValueError:
+                       except portage.exception.PackageNotFound:
                                missing_atoms.append(mydep)
 
                if not self.validate_blockers():