summaryrefslogtreecommitdiff
path: root/apt
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2009-04-12 19:55:55 +0200
committerJulian Andres Klode <jak@debian.org>2009-04-12 19:55:55 +0200
commit23d29169c30b2f05a0c2943832a7cf7288ff5802 (patch)
tree5f3d6ff39d06199a0423913284149fb6e59436d5 /apt
parent3bbb577e8a47ed05041c2532531e0e263f821c2c (diff)
downloadpython-apt-23d29169c30b2f05a0c2943832a7cf7288ff5802.tar.gz
apt/package.py: Handle cases where no candidate is available, by returning
None in the candidate property. (Closes: #523801)
Diffstat (limited to 'apt')
-rw-r--r--apt/package.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/apt/package.py b/apt/package.py
index 0e13957f..ec88a456 100644
--- a/apt/package.py
+++ b/apt/package.py
@@ -491,7 +491,9 @@ class Package(object):
"""Return the candidate version of the package.
:since: 0.7.9"""
- return Version(self, self._pcache._depcache.GetCandidateVer(self._pkg))
+ cand = self._pcache._depcache.GetCandidateVer(self._pkg)
+ if cand is not None:
+ return Version(self, cand)
@property
def installed(self):