From: Andrew Bartlett Date: Wed, 24 Aug 2016 23:28:32 +0000 (+1200) Subject: pydsdb: Raise TypeError for type errors, rather than incorrectly raising an LdbError X-Git-Tag: tevent-0.9.31~524 X-Git-Url: http://git.samba.org/samba.git/?p=sfrench%2Fsamba-autobuild%2F.git;a=commitdiff_plain;h=9142a01bb55a09e836c70d15fe420fb2599aec6f pydsdb: Raise TypeError for type errors, rather than incorrectly raising an LdbError Signed-off-by: Andrew Bartlett Reviewed-by: Garming Sam --- diff --git a/source4/dsdb/pydsdb.c b/source4/dsdb/pydsdb.c index efaf66b93ca..1fe8c13e6e5 100644 --- a/source4/dsdb/pydsdb.c +++ b/source4/dsdb/pydsdb.c @@ -34,14 +34,14 @@ void initdsdb(void); /* 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")) { \ - PyErr_SetString(py_ldb_get_exception(), "Ldb connection object required"); \ + PyErr_SetString(PyExc_TypeError, "Ldb connection object required"); \ return NULL; \ } \ ldb = pyldb_Ldb_AsLdbContext(py_ldb); #define PyErr_LDB_DN_OR_RAISE(py_ldb_dn, dn) \ if (!py_check_dcerpc_type(py_ldb_dn, "ldb", "Dn")) { \ - PyErr_SetString(py_ldb_get_exception(), "ldb Dn object required"); \ + PyErr_SetString(PyExc_TypeError, "ldb Dn object required"); \ return NULL; \ } \ dn = pyldb_Dn_AsDn(py_ldb_dn);