def get_attribute(obj, name):
try:<EOL><INDENT>attribute = getattr(obj, name)<EOL><DEDENT>except AttributeError:<EOL><INDENT>raise unittest.SkipTest("<STR_LIT>" % (<EOL>obj.__name__, name))<EOL><DEDENT>else:<EOL><INDENT>return attribute<EOL><DEDENT>
Get an attribute, raising SkipTest if AttributeError is raised.