Re: Declaring PEP 3333 accepted (was: PEP 444 != WSGI 2.0)

Graham Dumpleton <[email protected]>
Newsgroups gmane.comp.python.web
Message-ID <[email protected]>
On 7 January 2011 17:19, Alice Bevan–McGregor <alice-h+KYGxXtFYrqlBn2x/[email protected]> wrote:
>> -                    raise exc_info[0], exc_info[1], exc_info[2]
>> +                    raise
>> exc_info[0](exc_info[1]).with_traceback(exc_info[2])
>
> The exception raising syntax has changed; you can not re-raise an exception
> using tuple notation any more.  The new syntax is far clearer, but I'm
> unsure of back-compatibility or even if it is possible to emulate it
> completely as a polygot (2.x and 3.x w/ same code).

PJE already said that intent is that PEP will only have Python 3
compatible code in it. Not attempting to have examples that work for
both Python 2 and Python 3.

That sounds to me then that we should be using what 2to3 changed it to. Ie.,

                  if headers_sent:
                    # Re-raise original exception if headers sent
                    raise exc_info[0](exc_info[1]).with_traceback(exc_info[2])

Graham


Graham
_______________________________________________
Web-SIG mailing list
[email protected]
Web SIG: http://www.python.org/sigs/web-sig
Unsubscribe: http://mail.python.org/mailman/options/web-sig/gcpw-web-sig%40m.gmane.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.