This macro already checks the type, so we do not need to call
py_check_dcerpc_type() and prepares to move this macro into pyldb.h
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
/* FIXME: These should be in a header file somewhere */
#define PyErr_LDB_OR_RAISE(py_ldb, ldb) \
- if (!py_check_dcerpc_type(py_ldb, "ldb", "Ldb")) { \
+ ldb = pyldb_Ldb_AsLdbContext(py_ldb); \
+ if (!ldb) { \
PyErr_SetString(PyExc_TypeError, "Ldb connection object required"); \
return NULL; \
- } \
- ldb = pyldb_Ldb_AS_LDBCONTEXT(py_ldb);
+ }
#define PyErr_LDB_DN_OR_RAISE(py_ldb_dn, dn) \
if (!py_check_dcerpc_type(py_ldb_dn, "ldb", "Dn")) { \