Accept AttributeError when checking attribute access is disallowed.