[Python-checkins] r87816 - peps/trunk/pep-3333.txt

phillip.eby python-checkins at python.org
Fri Jan 7 16:45:26 CET 2011


Author: phillip.eby
Date: Fri Jan  7 16:45:26 2011
New Revision: 87816

Log:
Fix re-raise syntax for Python 3


Modified:
   peps/trunk/pep-3333.txt

Modified: peps/trunk/pep-3333.txt
==============================================================================
--- peps/trunk/pep-3333.txt	(original)
+++ peps/trunk/pep-3333.txt	Fri Jan  7 16:45:26 2011
@@ -323,7 +323,7 @@
                 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 @@
 
 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


More information about the Python-checkins mailing list