Best way to handle exceptions with try/finally

Thomas Guettler niemand.leermann at
Wed May 24 13:59:47 CEST 2006

Am Tue, 23 May 2006 12:47:05 -0700 schrieb Carl J. Van Arsdall:

> Hey python people,
> I'm interested in using the try/finally clause to ensure graceful 
> cleanup regardless of how a block of code exits.  However, I still am 
> interested in capturing the exception.

You can reraise the exception:

    raise # reraise the caught exception

Thomas Güttler,
E-Mail: guettli (*) thomas-guettler + de
Spam Catcher: niemand.leermann at

More information about the Python-list mailing list