← Back to team overview

dolfin team mailing list archive

Re: Raising exceptions in python

 

On Thu, Dec 01, 2011 at 11:12:57AM +0100, Martin Sandve Alnæs wrote:
> There's a lot of
>     raise ExceptionType, "message"
> in pydolfin. This is not recommended style, and I think it
> will be a problem in the (distant?) future when converting
> to python 3. For now it's not a problem, but keep it in mind
> to always do
>     raise ExceptionType("message")
> in new code and fix this in other code over time.
>
> Martin

I think we decided that we should always use cpp.dolfin_error even
from Python so all those need to be changed anyway.

--
Anders


References