def check_get_set_raises(exc, func, arg):
    try:
        got = func(arg)
    except exc as e:
        pass
    else:
        raise error(("%s with arg %r didn't raise %s - returned %r" % (func, arg, exc, got)))
def check_get_set_raises(exc, func, arg):
    try:
        got = func(arg)
    except exc as e:
        pass
    else:
        raise error(("%s with arg %r didn't raise %s - returned %r" % (func, arg, exc, got)))