[yum-commits] repoquery.py

zpavlas at osuosl.org zpavlas at osuosl.org
Wed May 2 07:26:54 UTC 2012


 repoquery.py |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 7661d5028f816e2755ecba7bf83e5c420f5065ca
Author: Zdeněk Pavlas <zpavlas at redhat.com>
Date:   Thu Apr 26 15:13:31 2012 +0200

    repoquery: handle RepoError.  BZ 816556

diff --git a/repoquery.py b/repoquery.py
index 7660789..a854c23 100755
--- a/repoquery.py
+++ b/repoquery.py
@@ -25,7 +25,6 @@ import fnmatch
 import time
 import os
 import os.path
-import exceptions
 import urlparse
 
 from optparse import OptionParser
@@ -123,7 +122,7 @@ convertmap = { 'date': sec2date,
                'h':  size2h,
              }
 
-class queryError(exceptions.Exception):
+class queryError(Exception):
     def __init__(self, value=None):
         Exception.__init__(self)
         self.value = value
@@ -856,6 +855,8 @@ class YumBaseQuery(yum.YumBase):
                     pkgs = self.pkgSack.returnNewestByNameArch(**kwargs)
                 except yum.Errors.PackageSackError:
                     pkgs = []
+                except yum.Errors.RepoError, e:
+                    raise queryError(e)
         else:
             what = self.options.pkgnarrow
             ygh = self.doPackageLists(what, **kwargs)


More information about the Yum-commits mailing list