Return locally installed version if no newer is available

This commit is contained in:
Thomas S Hatch 2013-12-30 14:24:02 -07:00
parent 2d91584ee8
commit 75fd92fd98

View File

@ -78,6 +78,14 @@ def latest_version(*names, **kwargs):
except (ValueError, IndexError):
pass
pkgs = {}
for name in names:
if not ret[name]:
if not pkgs:
pkgs = list_pkgs()
if name in pkgs:
ret[name] = pkgs[name]
# Return a string if only one package name passed
if len(names) == 1:
return ret[names[0]]