aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2010-08-02 05:07:49 -0300
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2010-08-02 05:07:49 -0300
commitf21bc7aa8a9a140099a8b8a91d730c91af22d4b3 (patch)
treee8e2dea1c878f55e46b8f684e583a9e585b9b969
parentchanged the url of the git repository with the package database. (diff)
downloadg-octave-f21bc7aa8a9a140099a8b8a91d730c91af22d4b3.tar.gz
g-octave-f21bc7aa8a9a140099a8b8a91d730c91af22d4b3.tar.bz2
g-octave-f21bc7aa8a9a140099a8b8a91d730c91af22d4b3.zip
fixed the version comparation
-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):