Use of finally/return considered harmful
Bug #1324277 reported by
Johannes Erdfelt
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Medium
|
Johannes Erdfelt |
Bug Description
Doing a return from a finally block will end up silently dropping exceptions.
This can cause unexpected behavior at runtime where unhandled exceptions are silently dropped when not intended.
This has caused some tests that would should fail because of API changes, to end up passing.
Examples are test_init_
tags: | added: compute |
Changed in nova: | |
milestone: | none → juno-2 |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | juno-2 → 2014.2 |
To post a comment you must log in.
I don't know if hacking checks can encompass multiple line statements of this nature, but if so it would be nice to have a rule to check for this.