try:
fn(self, *args, **kwargs)
except SystemError as e:
ftr.set_exception(e.__cause__)
except Exception as e:
ftr.set_exception(e)
finally:
return ftr
It has a return statement in a finally block, which would swallow any in-flight exception.
This means that if a BaseException (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.
In https://github.com/couchbase/couchbase-python-client/blob/465027c0253e3ba059eb1045793e5a3689bfa00f/acouchbase/transactions/transactions.py#L85
there is this snippet:
It has 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.