diff options
author | Benjamin Peterson <benjamin@python.org> | 2014-10-29 20:54:24 -0400 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2014-10-29 20:54:24 -0400 |
commit | d7c4f2ed2847c1472c0e60f20e25db20e60dc7d7 (patch) | |
tree | 998168d25045fd0cefda921c2e09fe869f42288d /documentation/index.rst | |
parent | ebe2cd1761a7da32e3fb24fdc53b80914ab1d300 (diff) | |
download | six-git-d7c4f2ed2847c1472c0e60f20e25db20e60dc7d7.tar.gz |
add raise_from (fixes #102)
Patch from Robert Collins.
Diffstat (limited to 'documentation/index.rst')
-rw-r--r-- | documentation/index.rst | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/documentation/index.rst b/documentation/index.rst index c7ca996..7851421 100644 --- a/documentation/index.rst +++ b/documentation/index.rst @@ -282,6 +282,13 @@ Python 2 and 3. ok. :) +.. function:: raise_from(exc_value, exc_value_from) + + Raise an exception from a context. On Python 3, this is equivalent to + ``raise exc_value from exc_value_from``. On Python 2, which does not support + exception chaining, it is equivalent to ``raise exc_value``. + + .. function:: reraise(exc_type, exc_value, exc_traceback=None) Reraise an exception, possibly with a different traceback. In the simple |