How to catch a generic exception?

F. GEIGER fgeiger at datec.at
Thu Mar 4 10:52:09 EST 2004


try:
   generateSomeException()
except Exception, e:
  print e


HTH
Franz

"Boogie El Aceitoso" <frr149 at telefonica.net> schrieb im Newsbeitrag
news:dcie40t170sbhifs7mihfg9h1jm5prnbf0 at 4ax.com...
> Hi,
>
> How can I catch a generic exception (without knowing a priori what
exception
> it will be)?
>
> For example, something like this
> try:
>    generateSomeException()
> except e:
>   print e
>
>





More information about the Python-list mailing list