MerossIot icon indicating copy to clipboard operation
MerossIot copied to clipboard

return in finally can swallow exceptions

Open iritkatriel opened this issue 1 year ago • 1 comments

In https://github.com/albertogeniola/MerossIot/blob/58de4e0594aa2a471c0c50b7230ceaca72b596d6/meross_iot/http_api.py#L372 there is a return statement in a finally block, which would swallow any in-flight exception.

This means that if an exception other than ValueError(includingBaseException such as KeyboardInterrupt) is raised from the try body, or any exception is raised from an except: clause, it will not propagate on as expected.

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

iritkatriel avatar Oct 22 '24 22:10 iritkatriel

Donation bot here. Supporters can mark their interest in this issue by adding a comment starting with "+1" (without quotes) or adding the "#supporter_sponsor" keyword (without quotes) in their comments.

You can become a donor by subscribing as Sponsor from the GitHub sponsorship page or from the BuyMeACoffee page.

Issues marked by donors will be labeled accordingly and handled with special care

donations-bot-prod[bot] avatar Oct 22 '24 22:10 donations-bot-prod[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Dec 28 '24 04:12 stale[bot]