A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-May/053852.html below:

[Python-Dev] PEP 344: Exception Chaining and Embedded Tracebacks

[Python-Dev] PEP 344: Exception Chaining and Embedded Tracebacks [Python-Dev] PEP 344: Exception Chaining and Embedded TracebacksEric Nieuwland eric.nieuwland at xs4all.nl
Tue May 17 19:49:55 CEST 2005
Guido van Rossum wrote:
> Consider
>
>     try:
>         BLOCK
>     except EXCEPTION, VAR:
>         HANDLER
>
> I'd like to see this translated into
>
>     try:
>         BLOCK
>     except EXCEPTION, VAR:
>         __context = VAR
>         try:
>             HANDLER
>         except Exception, __error:
>             __error.__context__ = __context
>             raise

If I interpret the above translation correctly, then:
     try:
         BLOCK1
     except EXCEPTION1, VAR1:
         try:
             BLOCK2
         except EXCEPTION2, VAR2:
             HANDLER

with exceptions occuring in BLOCK1, BLOCK2 and HANDLER would result in 
HANDLER's exception with __context__ set to BLOCK1's exception and 
BLOCK2's exception would be lost.

--eric

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4