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/053644.html below:

[Python-Dev] Merging PEP 310 and PEP 340-redux?

[Python-Dev] Merging PEP 310 and PEP 340-redux? [Python-Dev] Merging PEP 310 and PEP 340-redux?Steven Bethard steven.bethard at gmail.com
Wed May 11 23:47:58 CEST 2005
On 5/11/05, Steven Bethard <steven.bethard at gmail.com> wrote:
> If you want the default to be that the exception gets re-raised
> (instead of being suppressed as it is above), I think you could just
> change the finally block to something like:
> 
>     finally:
>         if stmt_exit(*exc):
>            raise exc[0], exc[1], exc[2]
> 
> That would mean that if any nonzero object was returned from __exit__,
> the exception would be reraised.

Oops.  This should have been:

    finally:
       if not stmt_exit(*exc):
          raise exc[0], exc[1], exc[2]

This would mean that if a function returned None (or any other "False"
object) the exception would be reraised.  Suppressing the reraising of
the exception would require returning a nonzero object.

STeVe
-- 
You can wordify anything if you just verb it.
        --- Bucky Katt, Get Fuzzy
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