Reraising exceptions "intact"

Jesus Cea Avion jcea at argo.es
Fri Jun 8 17:41:41 CEST 2001


I'd like to know how to reraise a "catched" exception, intact:

while 1
  try :
    func()
  except exceptions.KeyboardInterrupt :
    raise exceptions.KeyboardInterrupt
  except :
    pass

Here we keep "func" running except if the user press CONTROL+C. But in
this case I'd like to see a traceback for the original interrupt point,
not the "artificial" "raise".

Any suggestion?

PS: Please, send me a copy of your reply to mi mailbox, since I can't
follow the group timely.

Thanks in advance.

-- 
Jesus Cea Avion                         _/_/      _/_/_/        _/_/_/
jcea at argo.es http://www.argo.es/~jcea/ _/_/    _/_/  _/_/    _/_/  _/_/
                                      _/_/    _/_/          _/_/_/_/_/
PGP Key Available at KeyServ   _/_/  _/_/    _/_/          _/_/  _/_/
"Things are not so easy"      _/_/  _/_/    _/_/  _/_/    _/_/  _/_/
"My name is Dump, Core Dump"   _/_/_/        _/_/_/      _/_/  _/_/
"El amor es poner tu felicidad en la felicidad de otro" - Leibniz



More information about the Python-list mailing list