saving an exception

2006-10-02 Thread Bryan
hi, i would like to save an exception and reraise it at a later time. something similar to this: exception = None def foo():     try:         1/0     except Exception, e:         exception = e if exception: raise exception i have a need to do this because in my example foo is a callback fro

Re: saving an exception

2006-10-02 Thread Ben Cartwright
Bryan wrote: > i would like to save an exception and reraise it at a later time. > > something similar to this: > > exception = None > def foo(): > try: > 1/0 > except Exception, e: > exception = e > > if exception: raise exception > > with the above code, i'm able to succes

Re: saving an exception

2006-10-02 Thread Steve Holden
Bryan wrote: > hi, > > i would like to save an exception and reraise it at a later time. > > > something similar to this: > > exception = None > def foo(): > try: > 1/0 > except Exception, e: > exception = e > > if exception: raise exception > > > i have a need to do

Re: saving an exception

2006-10-03 Thread Gabriel G
At Tuesday 3/10/2006 02:15, Bryan wrote: >i would like to save an exception and reraise it at a later time. >def foo(): >Â Â try: >Â Â Â Â 1/0 >Â Â except Exception, e: >Â Â Â Â exception = e > >if exception: raise exception > >with the above code, i'm able to successfully raise the ex