How to catch a generic exception?

Peter Maas fpetermaas at netscape.net
Thu Mar 4 11:19:09 EST 2004


Peter Maas schrieb:
> --- throw:
> 
 > try:
 >     raise Exception, "Something is rotten in the state of Denmark"
 > except e:
 >     print e

Sorry, lazy copy. Correction:

try:
     raise Exception, "Something is rotten in the state of Denmark"
except Exception, e:
     print e

Mit freundlichen Gruessen,

Peter Maas

-- 
-------------------------------------------------------------------
Peter Maas, M+R Infosysteme, D-52070 Aachen, Hubert-Wienen-Str. 24
Tel +49-241-93878-0 Fax +49-241-93878-20 eMail peter.maas at mplusr.de
-------------------------------------------------------------------



More information about the Python-list mailing list