Raise a PackageNotFound exception instead of a ValueError
authorZac Medico <zmedico@gentoo.org>
Fri, 12 Oct 2007 07:01:59 +0000 (07:01 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 12 Oct 2007 07:01:59 +0000 (07:01 -0000)
in order to avoid ambiguity if an unexpected ValueError
occurs. (trunk r8043)

svn path=/main/branches/2.1.2/; revision=8072

bin/emerge

index e93872291aa1b70bcd9ef66cfeaffa9bf2d0f95b..274f2ffbdae308e444697fde6d7f035b9da5194a 100755 (executable)
@@ -1947,7 +1947,7 @@ class depgraph:
 
                                if not matched_packages:
                                        if raise_on_missing:
-                                               raise ValueError
+                                               raise portage_exception.PackageNotFound(x)
                                        if not arg:
                                                xinfo='"'+x+'"'
                                        else:
@@ -2673,7 +2673,7 @@ class depgraph:
                                        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():