[Freeipa-devel] [PATCHES 0442-0449] Pylint: sunday code cleanup

Christian Heimes cheimes at redhat.com
Mon Mar 21 09:33:30 UTC 2016


On 2016-03-21 10:29, Petr Spacek wrote:
> On 20.3.2016 21:56, Martin Basti wrote:
>> Patches attached.
> 
> I do not really like
> freeipa-mbasti-0442-pylint-remove-bare-except
> because it replaces most of
> 
> try: ... except:
> 
> with
> 
> try: ... except Exception:
> 
> 
> which AFAIK does not add any value. It would be better to replace Exception
> with more specific exception so the code raises an error instead of continuing
> when something really unexpected happens.

It adds some value. A bare except also excepts signals like
KeyboardInterrupt and SystemExit. except Exception doesn't block these
exceptions.

But yes, more specific exceptions are better.

Christian


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20160321/029e3c37/attachment.sig>


More information about the Freeipa-devel mailing list