[Python-checkins] distutils2: Index crawling. Raise an exception when no release match the given requirements.
tarek.ziade
python-checkins at python.org
Sun Aug 8 11:50:47 CEST 2010
tarek.ziade pushed 2f87dcc4b65f to distutils2:
http://hg.python.org/distutils2/rev/2f87dcc4b65f
changeset: 501:2f87dcc4b65f
user: Alexis Metaireau <ametaireau at gmail.com>
date: Fri Aug 06 17:12:08 2010 +0200
summary: Index crawling. Raise an exception when no release match the given requirements.
files: src/distutils2/index/xmlrpc.py
diff --git a/src/distutils2/index/xmlrpc.py b/src/distutils2/index/xmlrpc.py
--- a/src/distutils2/index/xmlrpc.py
+++ b/src/distutils2/index/xmlrpc.py
@@ -3,7 +3,8 @@
from distutils2.errors import IrrationalVersionError
from distutils2.index.base import BaseClient
-from distutils2.index.errors import ProjectNotFound, InvalidSearchField
+from distutils2.index.errors import (ProjectNotFound, InvalidSearchField,
+ ReleaseNotFound)
from distutils2.index.dist import ReleaseInfo
from distutils2.version import get_version_predicate
@@ -97,6 +98,8 @@
index=self._index)
for version in versions])
project = project.filter(predicate)
+ if len(project) == 0:
+ raise ReleaseNotFound("%s" % predicate)
project.sort_releases(prefer_final)
return project
--
Repository URL: http://hg.python.org/distutils2
More information about the Python-checkins
mailing list