gssapi/oids.py
def add(self, new_oid):
        """
        Adds another :class:`OID` to this set.

        :param new_oid: the OID to add.
        :type new_oid: :class:`OID`
        """
        if self._oid_set[0]:
            oid_ptr = None
            if isinstance(new_oid, OID):
                oid_ptr = ffi.addressof(new_oid._oid)
            elif isinstance(new_oid, ffi.CData):
                if ffi.typeof(new_oid) == ffi.typeof('gss_OID_desc'):
                    oid_ptr = ffi.addressof(new_oid)
                elif ffi.typeof(new_oid) == ffi.typeof('gss_OID'):
                    oid_ptr = new_oid
            if oid_ptr is None:
                raise TypeError("Expected a gssapi.oids.OID, got " + str(type(new_oid)))

            minor_status = ffi.new('OM_uint32[1]')
            retval = C.gss_add_oid_set_member(minor_status, oid_ptr, self._oid_set)
            if GSS_ERROR(retval):
                raise _exception_for_status(retval, minor_status[0])
        else:
            raise GSSException("Cannot add a member to this OIDSet, its gss_OID_set is NULL!")
def add(self, new_oid):
        """
        Adds another :class:`OID` to this set.

        :param new_oid: the OID to add.
        :type new_oid: :class:`OID`
        """
        if self._oid_set[0]:
            oid_ptr = None
            if isinstance(new_oid, OID):
                oid_ptr = ffi.addressof(new_oid._oid)
            elif isinstance(new_oid, ffi.CData):
                if ffi.typeof(new_oid) == ffi.typeof('gss_OID_desc'):
                    oid_ptr = ffi.addressof(new_oid)
                elif ffi.typeof(new_oid) == ffi.typeof('gss_OID'):
                    oid_ptr = new_oid
            if oid_ptr is None:
                raise TypeError("Expected a gssapi.oids.OID, got " + str(type(new_oid)))

            minor_status = ffi.new('OM_uint32[1]')
            retval = C.gss_add_oid_set_member(minor_status, oid_ptr, self._oid_set)
            if GSS_ERROR(retval):
                raise _exception_for_status(retval, minor_status[0])
        else:
            raise GSSException("Cannot add a member to this OIDSet, its gss_OID_set is NULL!")
Adds another :class:`OID` to this set.

        :param new_oid: the OID to add.
        :type new_oid: :class:`OID`