def _safe_hasattr(o, attr):
try:<EOL><INDENT>has = hasattr(o, attr)<EOL><DEDENT>except: <EOL><INDENT>has = False<EOL>msg.err("<STR_LIT>".format(o, attr), <NUM_LIT:2>)<EOL>pass<EOL><DEDENT>return has<EOL>
Returns True if `o` has the specified attribute. Takes edge cases into
    account where packages didn't intend to be used like acorn uses them.