diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-04-05 06:37:24 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-05 06:37:24 (GMT) |
commit | 5affd23e6f42125998724787025080a24839266e (patch) | |
tree | 8b7ca82362e78a32805b117d574082d512251d3c /Lib/multiprocessing | |
parent | 43ba8861e0ad044efafa46a7cc04e12ac5df640e (diff) | |
download | cpython-5affd23e6f42125998724787025080a24839266e.zip cpython-5affd23e6f42125998724787025080a24839266e.tar.gz cpython-5affd23e6f42125998724787025080a24839266e.tar.bz2 |
bpo-29762: More use "raise from None". (#569)
This hides unwanted implementation details from tracebacks.
Diffstat (limited to 'Lib/multiprocessing')
-rw-r--r-- | Lib/multiprocessing/context.py | 2 | ||||
-rw-r--r-- | Lib/multiprocessing/pool.py | 6 | ||||
-rw-r--r-- | Lib/multiprocessing/process.py | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/Lib/multiprocessing/context.py b/Lib/multiprocessing/context.py index 623f6fb..a3d491b 100644 --- a/Lib/multiprocessing/context.py +++ b/Lib/multiprocessing/context.py @@ -189,7 +189,7 @@ class BaseContext(object): try: ctx = _concrete_contexts[method] except KeyError: - raise ValueError('cannot find context for %r' % method) + raise ValueError('cannot find context for %r' % method) from None ctx._check_available() return ctx diff --git a/Lib/multiprocessing/pool.py b/Lib/multiprocessing/pool.py index a545f3c..c2364ab 100644 --- a/Lib/multiprocessing/pool.py +++ b/Lib/multiprocessing/pool.py @@ -720,14 +720,14 @@ class IMapIterator(object): item = self._items.popleft() except IndexError: if self._index == self._length: - raise StopIteration + raise StopIteration from None self._cond.wait(timeout) try: item = self._items.popleft() except IndexError: if self._index == self._length: - raise StopIteration - raise TimeoutError + raise StopIteration from None + raise TimeoutError from None success, value = item if success: diff --git a/Lib/multiprocessing/process.py b/Lib/multiprocessing/process.py index bca8b7a..37365f2 100644 --- a/Lib/multiprocessing/process.py +++ b/Lib/multiprocessing/process.py @@ -199,7 +199,7 @@ class BaseProcess(object): try: return self._sentinel except AttributeError: - raise ValueError("process not started") + raise ValueError("process not started") from None def __repr__(self): if self is _current_process: |