Fix re-raise syntax for Python 3
This commit is contained in:
parent
7a010e3932
commit
ae2d59f75b
|
@ -323,7 +323,7 @@ server.
|
|||
try:
|
||||
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:
|
||||
exc_info = None # avoid dangling circular ref
|
||||
elif headers_set:
|
||||
|
@ -874,9 +874,9 @@ occurred.
|
|||
|
||||
However, if ``exc_info`` is provided, and the HTTP headers have already
|
||||
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
|
||||
principle should abort the application. (It is not safe for the
|
||||
|
|
Loading…
Reference in New Issue