change an exception's message and re-raise it

Phlip phlip2005 at gmail.com
Fri Jan 1 16:21:13 CET 2010


On Dec 31 2009, 4:30 pm, Steven D'Aprano <st... at REMOVE-THIS-
cybersource.com.au> wrote:

> For the record you can get the exception type from type(e):
>
> raise type(e)("whatever you want")
>
> but that creates a new exception, not re-raising the old one.

Except if a type constructs with some other number of arguments,
apparently...



More information about the Python-list mailing list