def get_attribute(obj, name):
    """Get an attribute, raising SkipTest if AttributeError is raised."""
    try:
        attribute = getattr(obj, name)
    except __HOLE__:
        raise unittest.SkipTest("object %r has no attribute %r" % (obj, name))
    else:
        return attribute
dataset/ETHPy150Open OpenCobolIDE/OpenCobolIDE/open_cobol_ide/extlibs/future/backports/test/support.py/get_attribute