diff options
| author | Julian Andres Klode <jak@debian.org> | 2010-01-15 15:32:13 +0100 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2010-01-15 15:32:13 +0100 |
| commit | fec0cfe1617ccfcbb7b291ba00dedacdd3f133f7 (patch) | |
| tree | 508002f92d02d9e17763105dc2ec0a089b148549 | |
| parent | 28f42c1060c652e6f650ba4e046e3f8ab021d91b (diff) | |
| parent | 4ebf94a774873aef709bab624edb3724fe870f7d (diff) | |
| download | python-apt-fec0cfe1617ccfcbb7b291ba00dedacdd3f133f7.tar.gz | |
Return False in Cache.is_virtual_package if the package does not exist.
| -rw-r--r-- | apt/cache.py | 8 | ||||
| -rw-r--r-- | debian/changelog | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/apt/cache.py b/apt/cache.py index fdd50fa6..eea06d56 100644 --- a/apt/cache.py +++ b/apt/cache.py @@ -260,8 +260,12 @@ class Cache(object): def is_virtual_package(self, pkgname): """Return whether the package is a virtual package.""" - pkg = self._cache[pkgname] - return bool(pkg.provides_list and not pkg.version_list) + try: + pkg = self._cache[pkgname] + except KeyError: + return False + else: + return bool(pkg.provides_list and not pkg.version_list) def get_providing_packages(self, virtual): """ diff --git a/debian/changelog b/debian/changelog index 450492c4..a7204a0a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,8 @@ python-apt (0.7.93) UNRELEASED; urgency=low like apt-get --print-uris update (cf. #551164). * Build for all supported Python versions. - Disable 2.6 and 3.1 builds previously available in experimental. + * Merge lp:~forest-bond/python-apt/cache-is-virtual-package-catch-key-error + - Return False in Cache.is_virtual_package if the package does not exist. [ Colin Watson ] * apt/progress/__init__.py: |
