summaryrefslogtreecommitdiff
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
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)
-rw-r--r--apt/package.py4
-rw-r--r--debian/changelog7
2 files changed, 10 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):
diff --git a/debian/changelog b/debian/changelog
index d9258436..83b00150 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+python-apt (0.7.10.3) unstable; urgency=low
+
+ * apt/package.py: Handle cases where no candidate is available, by returning
+ None in the candidate property. (Closes: #523801)
+
+ -- Julian Andres Klode <jak@debian.org> Sun, 12 Apr 2009 19:50:26 +0200
+
python-apt (0.7.10.2) unstable; urgency=low
* apt/package.py: Handle cases where no candidate is available and