Because it involves a generator, @contextmanager creates managers that
are incompatible with ExitStack.pop_all() because they close during
that call -- exactly what pop_all() is intended to avoid.
So begin dropping @contextmanager in preference to explicit context
management classes/methods.
cf. https://github.com/python/cpython/issues/88458
Signed-off-by: Rob Browning <rlb@defaultvalue.org>