Which exception has been used? (was: Which exception to use?)

Chirayu Krishnappa thephoenix235 at gmx.net
Thu Jan 30 21:17:57 EST 2003


python 2.2.2 does not allow both an except block and a finally block
for the same try block. i have no idea about 2.3alpha.

>Now, hopefully you know about the "finally" claus:
>
>ie.
>
>try:
>	mutex.acquire()
>	doSomethingHeavyDuty()
>except:
>	excInfo = sys.exc_info()
>	myErrorHandler.handler(excInfo)
>finall:
>	mutex.release()
>
>Note: You should use sys.exc_info() right away just incase another
>exception occurs - in that case, the old exception info will be lost.
>
>





More information about the Python-list mailing list