Bug: return in finally can swallow exceptions #7599
Labels
area/local/start-api
sam local start-api command
blocked/more-info-needed
More info is needed from the requester. If no response in 14 days, it will become stale.
At this location:
aws-sam-cli/samcli/local/apigw/local_apigw_service.py
Line 721 in 97e63dc
there is a
return
statement in afinally
block, which would swallow any in-flight exception.This means that if a
BaseException
(such asKeyboardInterrupt
) is raised from thetry
body, or any exception is raised from anexcept
: clause, it will not propagate on as expected.See also https://docs.python.org/3/tutorial/errors.html#defining-clean-up-actions.
The text was updated successfully, but these errors were encountered: