give equivalent code for raise from

This commit is contained in:
Benjamin Peterson 2012-02-27 10:51:11 -05:00
parent d3966c5fcd
commit 43650eddca
1 changed files with 6 additions and 0 deletions

View File

@ -50,6 +50,12 @@ printed. ``__cause__`` will return to its original purpose and values.
There is precedence for ``__suppress_context__`` with the
``print_line_and_file`` exception attribute.
To summarize, ``raise exc from cause`` will be equivalent to::
exc.__cause__ = cause
exc.__suppress_context__ = cause is None
raise exc
Patches
=======