'Returns true if the attribute exists on the object.
This is to allow some tests to be optional, because
_ldap is compiled with different properties depending
on the underlying C library.
This could me made to thrown an exception if you want the
tests to be strict.'

def _require_attr(self, obj, attrname):

    if hasattr(obj, attrname):
        return True
    return False
