aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--g_octave/description_tree.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/g_octave/description_tree.py b/g_octave/description_tree.py
index fb184a4..77be7f3 100644
--- a/g_octave/description_tree.py
+++ b/g_octave/description_tree.py
@@ -136,14 +136,14 @@ class DescriptionTree(object):
def latest_version(self, pkgname):
tmp = self.package_versions(pkgname)
- return tmp[-1]
+ return (len(tmp) > 0) and tmp[-1] or None
def version_compare(self, versions):
tmp = list(versions[:])
tmp.sort(key=cmp_to_key(vercmp))
- return tmp[-1]
+ return (len(tmp) > 0) and tmp[-1] or None
def packages(self):