]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Remove single occurrence of lost-exception warning
authorAngus Lees <gus@inodes.org>
Mon, 25 Aug 2014 02:48:02 +0000 (12:48 +1000)
committerAngus Lees <gus@inodes.org>
Sun, 19 Oct 2014 23:12:39 +0000 (10:12 +1100)
commitf16101d711fa7ba6c4290cf9ba9712c922fbef28
treecddd479fa9679ff7a44becc9821701b05efaef93
parent1aaa8b34466b0567c6a5ea0b607f1ac324ee5dfa
Remove single occurrence of lost-exception warning

Returning within a finally block can be surprising since the finally
block will "hijack" the regular return flow.  In this case, pylint is
trying to warn us that the return-within-finally would discard the
earlier caught exception.  For this particular function we don't care
that the exception is lost, so the existing code is correct but possibly
confusing.

Our options are:
1. Disable the lost-exception warning for this function
2. Rewrite the function to avoid return-within-finally

This change takes approach (2), since the required change is trivial.

This change also enables the corresponding pylint check now that the
only offending case has been removed.

Change-Id: If1706851b4bd67ebdbbdb3485984773598efdf7a
.pylintrc
neutron/api/v2/attributes.py