python-sdk icon indicating copy to clipboard operation
python-sdk copied to clipboard

return in finally can swallow exception

Open iritkatriel opened this issue 1 year ago • 0 comments

In https://github.com/optimizely/python-sdk/blob/40880ffad7403ef96c7b11b02a110fb42adf39c2/optimizely/config_manager.py#L153 there is a return statement in a finally block, which would swallow any in-flight exception.

This means that if any exception is raised from one of the except: clauses, it will not propagate on as expected.

See also https://docs.python.org/3/tutorial/errors.html#defining-clean-up-actions.

iritkatriel avatar Oct 24 '24 13:10 iritkatriel