summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorÉric Araujo <merwok@netwok.org>2011-06-04 20:33:16 (GMT)
committerÉric Araujo <merwok@netwok.org>2011-06-04 20:33:16 (GMT)
commit2ef747cb778a45ec7eb96f5ba5f725bbf53e970c (patch)
treeb0694504eee386e465bf832cb64fc13755a853d5 /Lib
parent35a4d01a927a9ad0a774eec6a9ee1b728279c5b6 (diff)
downloadcpython-2ef747cb778a45ec7eb96f5ba5f725bbf53e970c.zip
cpython-2ef747cb778a45ec7eb96f5ba5f725bbf53e970c.tar.gz
cpython-2ef747cb778a45ec7eb96f5ba5f725bbf53e970c.tar.bz2
Cleanup in packaging: don’t unnecessarily instantiate exceptions
Diffstat (limited to 'Lib')
-rw-r--r--Lib/packaging/pypi/dist.py2
-rw-r--r--Lib/packaging/pypi/simple.py2
-rw-r--r--Lib/packaging/run.py2
-rw-r--r--Lib/packaging/tests/test_uninstall.py2
4 files changed, 4 insertions, 4 deletions
diff --git a/Lib/packaging/pypi/dist.py b/Lib/packaging/pypi/dist.py
index 16510df..db04cda 100644
--- a/Lib/packaging/pypi/dist.py
+++ b/Lib/packaging/pypi/dist.py
@@ -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:
diff --git a/Lib/packaging/pypi/simple.py b/Lib/packaging/pypi/simple.py
index c492179..c372c6f 100644
--- a/Lib/packaging/pypi/simple.py
+++ b/Lib/packaging/pypi/simple.py
@@ -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)
diff --git a/Lib/packaging/run.py b/Lib/packaging/run.py
index 1895dde..7e791a4 100644
--- a/Lib/packaging/run.py
+++ b/Lib/packaging/run.py
@@ -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 = [
diff --git a/Lib/packaging/tests/test_uninstall.py b/Lib/packaging/tests/test_uninstall.py
index 4b37286..00e97e4 100644
--- a/Lib/packaging/tests/test_uninstall.py
+++ b/Lib/packaging/tests/test_uninstall.py
@@ -111,7 +111,7 @@ class UninstallTestCase(support.TempdirManager,
old = os.rename
def _rename(source, target):
- raise OSError()
+ raise OSError
os.rename = _rename
try: