mirror of https://github.com/python/cpython
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.
|
not return one existing distribution.
|
||||||
"""
|
"""
|
||||||
if len(self.dists) == 0:
|
if len(self.dists) == 0:
|
||||||
raise LookupError()
|
raise LookupError
|
||||||
if dist_type:
|
if dist_type:
|
||||||
return self[dist_type]
|
return self[dist_type]
|
||||||
if prefer_source:
|
if prefer_source:
|
||||||
|
|
|
@ -189,7 +189,7 @@ class Crawler(BaseClient):
|
||||||
self._process_index_page(predicate.name)
|
self._process_index_page(predicate.name)
|
||||||
|
|
||||||
if predicate.name.lower() not in self._projects:
|
if predicate.name.lower() not in self._projects:
|
||||||
raise ProjectNotFound()
|
raise ProjectNotFound
|
||||||
|
|
||||||
releases = self._projects.get(predicate.name.lower())
|
releases = self._projects.get(predicate.name.lower())
|
||||||
releases.sort_releases(prefer_final=prefer_final)
|
releases.sort_releases(prefer_final=prefer_final)
|
||||||
|
|
|
@ -383,7 +383,7 @@ def _search(dispatcher, args, **kw):
|
||||||
"""
|
"""
|
||||||
#opts = _parse_args(args[1:], '', ['simple', 'xmlrpc'])
|
#opts = _parse_args(args[1:], '', ['simple', 'xmlrpc'])
|
||||||
# 1. what kind of index is requested ? (xmlrpc / simple)
|
# 1. what kind of index is requested ? (xmlrpc / simple)
|
||||||
raise NotImplementedError()
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
actions = [
|
actions = [
|
||||||
|
|
|
@ -111,7 +111,7 @@ class UninstallTestCase(support.TempdirManager,
|
||||||
old = os.rename
|
old = os.rename
|
||||||
|
|
||||||
def _rename(source, target):
|
def _rename(source, target):
|
||||||
raise OSError()
|
raise OSError
|
||||||
|
|
||||||
os.rename = _rename
|
os.rename = _rename
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue