exceptions?

Gerrit Holl gerrit.holl at pobox.com
Fri Dec 17 13:38:36 EST 1999


zsoltman at my-deja.com wrote:
> def HandleTraceBack(excinfo2,msg):
>     import traceback
>     tb=traceback.format_list(traceback.extract_tb(excinfo2))
>     for each in tb:
>         msg=msg + each
>     raise ValueError,msg

>>> try:
...     1/0
... except:
...     import traceback
...     traceback.print_exc()
...     print 'still running'
...
Traceback (innermost last):
  File "<stdin>", line 2, in ?
ZeroDivisionError: integer division or modulo
still running

-- 
"Nature abhors a Vacuum"

  -- Brian Behlendorf on OSS (Open Sources, 1999 O'Reilly and Associates)
  4:04pm  up  4:55, 16 users,  load average: 0.00, 0.00, 0.00




More information about the Python-list mailing list