def iter_with(iterable, context_manager):
    """Iterate on `iterable`, `with`ing the context manager on every `next`."""
    while True:
        with context_manager:
            next_item = next(iterable)
        yield next_item
