return from finally clause

David Bolen db3l at fitlinxx.com
Mon Jun 11 18:06:04 EDT 2001


"Jürgen Hermann" <jh at web.de> writes:

> That means that if you (accidently?) return within a finally clause, you
> effectively eat the exception. This should be documented, or fixed.

It is documented - see section 7.4 in the language reference
(penultimate paragraph in my 1.5.2 version).  It's true if the finally
statement raises another execution or uses return, break or continue,
and is apparently due to the fact that the finally statement doesn't
have access to the exception information while executing.

--
-- David
-- 
/-----------------------------------------------------------------------\
 \               David Bolen            \   E-mail: db3l at fitlinxx.com  /
  |             FitLinxx, Inc.            \  Phone: (203) 708-5192    |
 /  860 Canal Street, Stamford, CT  06902   \  Fax: (203) 316-5150     \
\-----------------------------------------------------------------------/



More information about the Python-list mailing list