Skip to content

Exception can be swallowed by return in finally in examples/pyesprima.py #333

Description

@iritkatriel

This return statement will swallow any in-flight exception.

If the try block raises an exception which is not of type PyJsException (such as a KeyboardInterrupt), or the except block raises any exception, you would expect that exception to bubble up. However, the return in the finally overrides it, so the exception is swallowed.

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions