NeBlackCat <[EMAIL PROTECTED]> wrote:
> I've now also looked at this from a traceback and stack frame walking
> perspective as well and it seems impossible, ie. it see,s impossible to
> create a function AmIHandlingAnException() which would behave as follows:
>
>try:
>a=a+1
>e
Duncan Booth wrote:
> "NeBlackCat (lists)" <[EMAIL PROTECTED]> wrote:
>
>> Depending on what you read, sys.exc_info() is supposed to return
>> (None,None,None) when there is no active exception, but it seems that
>> it returns info about the last exception when there isn't one
>> currently active
I've now also looked at this from a traceback and stack frame walking
perspective as well and it seems impossible, ie. it see,s impossible to
create a function AmIHandlingAnException() which would behave as follows:
try:
a=a+1
except:
pass
try:
AmIHandlingAnException()
Thanks Duncan - that does clear things up for me on how sys.exc_info()
it actually works!
But it does seem that there is no way to test "am I currently running in
the scope of handling of an exception", which is what I need. If there
was, I could then rely on sys.exc_info() to examine the excep
"NeBlackCat (lists)" <[EMAIL PROTECTED]> wrote:
> Depending on what you read, sys.exc_info() is supposed to return
> (None,None,None) when there is no active exception, but it seems that
> it returns info about the last exception when there isn't one
> currently active.
>
> For example:
>
> try
Hello everybody - my first post! And it may be the most monumentally
stupid question ever asked, but I just can't see an answer after several
hours experimenting, searching and reading.
It's simply this - how can a function determine whether or not it's
being called in handling of an exception