pyldb: Remove last caller to and definition of PyLdb_Check()
authorAndrew Bartlett <abartlet@samba.org>
Mon, 4 Dec 2023 22:59:46 +0000 (11:59 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Sun, 3 Mar 2024 22:33:35 +0000 (22:33 +0000)
This is now checked by PyArg_ParseTupleAndKeywords().

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
lib/ldb/pyldb.c

index 51a5a689f1953d986cd87861afe9b2a883a04155..0c81c1ba318f5534430a9ff4d8e7e19abe52145a 100644 (file)
@@ -70,7 +70,6 @@ static PyTypeObject PyLdbModule;
 static PyTypeObject PyLdbDn;
 #define pyldb_Dn_Check(ob) PyObject_TypeCheck(ob, &PyLdbDn)
 static PyTypeObject PyLdb;
-#define PyLdb_Check(ob) PyObject_TypeCheck(ob, &PyLdb)
 static PyTypeObject PyLdbMessageElement;
 #define pyldb_MessageElement_Check(ob) PyObject_TypeCheck(ob, &PyLdbMessageElement)
 
@@ -3758,11 +3757,6 @@ static PyObject *py_ldb_msg_from_dict(PyTypeObject *type, PyObject *args)
                return NULL;
        }
 
-       if (!PyLdb_Check(py_ldb)) {
-               PyErr_SetString(PyExc_TypeError, "Expected Ldb");
-               return NULL;
-       }
-
        /* mask only flags we are going to use */
        mod_flags = LDB_FLAG_MOD_TYPE(mod_flags);
        if (!mod_flags) {