A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2004-June/045675.html below:

[Python-Dev] Re-raise in absence of an "active" exception

[Python-Dev] Re-raise in absence of an "active" exception [Python-Dev] Re-raise in absence of an "active" exception"Martin v. Löwis" martin at v.loewis.de
Mon Jun 28 01:17:08 EDT 2004
Greg Ewing wrote:
>>I'm actually surprised that the exception is cleared when the
>>function that has the exception handler completes.
> 
> 
> I think it's probably when the "except" clause of the
> exception handler completes, not the function.

See for yourself:

def f():
   try:
     raise Exception, "Hello"
   except:
     pass
   raise

f()

gives

Traceback (most recent call last):
   File "c.py", line 8, in ?
     f()
   File "c.py", line 3, in f
     raise Exception, "Hello"
Exception: Hello

Regards,
Martin


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