summaryrefslogtreecommitdiff
path: root/apt
diff options
context:
space:
mode:
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):