Always raise KeyError (instead of sometimes StopIteration) from InstalledPkg if not found by name.

git-svn-id: svn+ssh://rpmlint.zarb.org/home/projects/rpmlint/svn/trunk@1541 9bc8b190-ac0f-0410-8968-dc7d1f502856
This commit is contained in:
Ville Skyttä 2009-02-01 21:54:11 +00:00
parent 668a38910a
commit 709e363748
1 changed files with 4 additions and 1 deletions

5
Pkg.py
View File

@ -543,7 +543,10 @@ class InstalledPkg(Pkg):
tab = ts.dbMatch('name', name)
if not tab:
raise KeyError(name)
theHdr = tab.next()
try:
theHdr = tab.next()
except StopIteration:
raise KeyError(name)
else:
db = rpm.opendb()
tab = db.findbyname(name)