Fix re-raise syntax for Python 3

This commit is contained in:
Phillip J. Eby 2011-01-07 15:45:26 +00:00
parent 7a010e3932
commit ae2d59f75b
1 changed files with 3 additions and 3 deletions

View File

@ -323,7 +323,7 @@ server.
try: try:
if headers_sent: if headers_sent:
# Re-raise original exception if headers sent # Re-raise original exception if headers sent
raise exc_info[0], exc_info[1], exc_info[2] raise exc_info[1].with_traceback(exc_info[2])
finally: finally:
exc_info = None # avoid dangling circular ref exc_info = None # avoid dangling circular ref
elif headers_set: elif headers_set:
@ -874,9 +874,9 @@ occurred.
However, if ``exc_info`` is provided, and the HTTP headers have already However, if ``exc_info`` is provided, and the HTTP headers have already
been sent, ``start_response`` **must** raise an error, and **should** been sent, ``start_response`` **must** raise an error, and **should**
raise the ``exc_info`` tuple. That is:: re-raise using the ``exc_info`` tuple. That is::
raise exc_info[0], exc_info[1], exc_info[2] raise exc_info[1].with_traceback(exc_info[2])
This will re-raise the exception trapped by the application, and in This will re-raise the exception trapped by the application, and in
principle should abort the application. (It is not safe for the principle should abort the application. (It is not safe for the