Cleanup in packaging: don’t unnecessarily instantiate exceptions

This commit is contained in:
Éric Araujo 2011-06-04 22:33:16 +02:00
parent 35a4d01a92
commit 2ef747cb77
4 changed files with 4 additions and 4 deletions

View File

@ -135,7 +135,7 @@ class ReleaseInfo(IndexReference):
not return one existing distribution.
"""
if len(self.dists) == 0:
raise LookupError()
raise LookupError
if dist_type:
return self[dist_type]
if prefer_source:

View File

@ -189,7 +189,7 @@ class Crawler(BaseClient):
self._process_index_page(predicate.name)
if predicate.name.lower() not in self._projects:
raise ProjectNotFound()
raise ProjectNotFound
releases = self._projects.get(predicate.name.lower())
releases.sort_releases(prefer_final=prefer_final)

View File

@ -383,7 +383,7 @@ def _search(dispatcher, args, **kw):
"""
#opts = _parse_args(args[1:], '', ['simple', 'xmlrpc'])
# 1. what kind of index is requested ? (xmlrpc / simple)
raise NotImplementedError()
raise NotImplementedError
actions = [

View File

@ -111,7 +111,7 @@ class UninstallTestCase(support.TempdirManager,
old = os.rename
def _rename(source, target):
raise OSError()
raise OSError
os.rename = _rename
try: