[Freeipa-devel] [PATCH] jderose 002 - Fix #498088
Rob Crittenden
rcritten at redhat.com
Wed Apr 29 02:29:25 UTC 2009
Jason Gerard DeRose wrote:
> This patch fixes #498088:
>
> https://bugzilla.redhat.com/show_bug.cgi?id=498088
>
> Under Python2.4 SystemExit subclasses from Exception (rather than from
> BaseException like in Python2.5), so cli.run() was catching a SystemExit
> raised by optparse.
>
> This patch changes cli.run() so it catches all StandardError instead of
> all Exception. I've been pretty good about doing this correctly, but I
> guess I missed this one.
>
> To reiterate the correct use: all custom exceptions should subclass from
> StandardError instead of Exception, and if doing a catch-all try/except,
> you should almost always do an `except StandardError` instead of `except
> Exception`.
>
> See the exception class hierarchy at the bottom each of these pages:
>
> http://www.python.org/doc/2.4.4/lib/module-exceptions.html
>
> http://www.python.org/doc/2.5.4/lib/module-exceptions.html
Ack and pushed to master
rob
More information about the Freeipa-devel
mailing list