Description of the problem
In
there is a
break statement in a
finally block, which would swallow any in-flight exception.
This means that if an unhandled exception (including a BaseException such as KeyboardInterrupt) is raised from the try body, it will not propagate on as expected.
If the intention is to suppress all exceptions, I would propose to make this clear by using except BaseException.
See also https://docs.python.org/3/tutorial/errors.html#defining-clean-up-actions.
Steps to reproduce
Link to data
No response
Expected results
Avoid break/continue/return in finally.
Actual results
NA
Additional information
NA
Description of the problem
In
mne-python/mne/viz/backends/_qt.py
Line 968 in e15292f
breakstatement in afinallyblock, which would swallow any in-flight exception.This means that if an unhandled exception (including a
BaseExceptionsuch asKeyboardInterrupt) is raised from thetrybody, it will not propagate on as expected.If the intention is to suppress all exceptions, I would propose to make this clear by using
except BaseException.See also https://docs.python.org/3/tutorial/errors.html#defining-clean-up-actions.
Steps to reproduce
NALink to data
No response
Expected results
Avoid break/continue/return in finally.
Actual results
NA
Additional information
NA