From a92ccc24f8dd7804d8d76ad737c9144f7163d300 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Sat, 30 Jun 2012 09:12:02 +0100 Subject: [PATCH] Prefer a generic over one which doesn't match --- zeroinstall/injector/distro.py | 4 ++-- zeroinstall/injector/model.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/zeroinstall/injector/distro.py b/zeroinstall/injector/distro.py index ed96dbb..00fa946 100644 --- a/zeroinstall/injector/distro.py +++ b/zeroinstall/injector/distro.py @@ -151,8 +151,8 @@ class Distribution(object): the same score, get_package_info is called for all of them. @param distribution: a distribution name @type distribution: str - @return: an integer, or None if there is no match at all - @rtype: int | None + @return: an integer, or -1 if there is no match at all + @rtype: int """ return 0 diff --git a/zeroinstall/injector/model.py b/zeroinstall/injector/model.py index 6c22133..cfeb9d9 100644 --- a/zeroinstall/injector/model.py +++ b/zeroinstall/injector/model.py @@ -1179,7 +1179,7 @@ class ZeroInstallFeed(object): for item, item_attrs in self._package_implementations: distro_names = item_attrs.get('distributions', '') for distro_name in distro_names.split(' '): - score = distro.get_score(distro_name) + score = distro.get_score(distro_name) if distro_name else 0.5 if score > best_score: best_score = score best_impls = [] -- 2.11.4.GIT