[BangPypers] Fwd: Nested try-catch
bhaskar.jain2002 at gmail.com
Wed Oct 7 06:50:15 CEST 2009
My mails seem not to go :(
---------- Forwarded message ----------
From: bhaskar jain <bhaskar.jain2002 at gmail.com>
Date: Wed, Oct 7, 2009 at 9:21 AM
Subject: Re: [BangPypers] Nested try-catch
To: Bangalore Python Users Group - India <bangpypers at python.org>
Anand, nice find..
But i read this in python docs -
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."
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>
> > 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. :)
> BangPypers mailing list
> BangPypers at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the BangPypers