]> arthur.barton.de Git - bup.git/commit
compat.pending_raise: allow/ignore None ex; make rethrow optional
authorRob Browning <rlb@defaultvalue.org>
Sun, 3 Oct 2021 17:44:25 +0000 (12:44 -0500)
committerRob Browning <rlb@defaultvalue.org>
Mon, 22 Nov 2021 06:33:50 +0000 (00:33 -0600)
commitca1b82ee3ab053c50fc7c1fc491928c5c2c8fc19
treebc48e61a9be27aeec25e5f6a7eceef9bd55fb169
parentac4fbf8d420916507b057d8c6e0173ba25bc3954
compat.pending_raise: allow/ignore None ex; make rethrow optional

This supports compact __exit__ handlers, e.g.

  def __exit__(self, type, value, ...):
      with pending_raise(value, rethrow=False):
          clean_up()

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/compat.py