Use with and contextlib.
@contextmanager
yield
from contextlib import contextmanager @contextmanager def suppressed(): # TODO: try/except around yield yield