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.
This return statement will swallow any in-flight exception.
If the
tryblock raises an exception which is not of typePyJsException(such as aKeyboardInterrupt), or theexceptblock 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.