summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt/cache.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/apt/cache.py b/apt/cache.py
index fa6c404c..19c0ee4e 100644
--- a/apt/cache.py
+++ b/apt/cache.py
@@ -245,7 +245,10 @@ class Cache(object):
def isVirtualPackage(self, pkgname):
"""Return whether the package is a virtual package."""
- pkg = self._cache[pkgname]
+ try:
+ pkg = self._cache[pkgname]
+ except KeyError:
+ return False
return bool(pkg.ProvidesList and not pkg.VersionList)
def getProvidingPackages(self, virtual):