Cleanup in packaging: don’t unnecessarily instantiate exceptions
This commit is contained in:
parent
35a4d01a92
commit
2ef747cb77
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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 = [
|
||||
|
|
|
@ -111,7 +111,7 @@ class UninstallTestCase(support.TempdirManager,
|
|||
old = os.rename
|
||||
|
||||
def _rename(source, target):
|
||||
raise OSError()
|
||||
raise OSError
|
||||
|
||||
os.rename = _rename
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue