@contextlib.contextmanager
def numpy_errors(**kwargs):

    old = numpy.seterr(**kwargs)

    try:
        yield
    except:
        raise
    finally:
        numpy.seterr(**old)
Temporarily modify numpy error options.
dataset/ETHPy150Open borg-project/borg/borg/util.py/numpy_errors