On 16 July 2013 22:25, Stéphane Blondon <stephane.blon...@gmail.com> wrote:

> > I checked the string exceptions in the code and they are not catched
> > (see shell commands used at this end of this message).
> > So I plan to wrap the string with an exception (Exception ou
> > TypeError). To me, the errors raised are not TypeError so it's not the
> > appropriate exception but if someone catched TypeError in another
> > software (outside Debian) it will work. It would not work with
> > Exception class. However, I still prefer raising Exception. Does
> > anyone have an opinion about that point?
> >
>
> Finally, I used BaseException. I added a patch to the bug report (#585291):


I would be inclined *not* to use BaseException for this - the intention is
that 'except Exception:' should catch all normal exceptions, and only
KeyboardInterrupt and SystemExit are outside that. I don't know the
specifics of the string exceptions you're updating, but almost anything
that Python code explicitly raises should inherit from Exception.

Thomas

Reply via email to