[BangPypers] Nested try-catch

bhaskar jain bhaskar.jain2002 at gmail.com
Wed Oct 7 05:51:23 CEST 2009


Anand, nice find..

But i read this in python docs -

"  Warning
Assigning the traceback return value to a local variable in a function that
is handling an exception will cause a circular reference. This will prevent
anything referenced by a local variable in the same function or by the
traceback from being garbage collected. Since most functions don’t need
access to the traceback, the best solution is to use something like exctype,
value = sys.exc_info()[:2] to extract only the exception type and value. If
you do need the traceback, make sure to delete it after use (best done with
a try ... finally statement) or to call exc_info() in a function that does
not itself handle an exception."


--Bhaskar.



On Tue, Oct 6, 2009 at 9:47 PM, Noufal Ibrahim <noufal at gmail.com> wrote:

> On Tue, Oct 6, 2009 at 9:24 PM, Anand Chitipothu <anandology at gmail.com>
> wrote:
> [..]
> >
> > Has anybody else faced similar situation? Any better solutions?
>
> Can't say I've come across it. However, it looks like (and was
> classified as) a bug which is fixed. :)
>
>
> --
> ~noufal
> http://nibrahim.net.in
> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/bangpypers/attachments/20091007/a9f3bc16/attachment.htm>


More information about the BangPypers mailing list