diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2009-07-18 16:11:21 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2009-07-18 16:11:21 +0200 |
commit | d356669492912ad97d031694123b628a9307c3bd (patch) | |
tree | 86f1e6d34980ef39c4d56b9e719195480b11817e /source4/scripting | |
parent | 8c5aff207d25764dd457050c2e5975b4b42c917f (diff) | |
download | samba-d356669492912ad97d031694123b628a9307c3bd.tar.gz samba-d356669492912ad97d031694123b628a9307c3bd.tar.bz2 samba-d356669492912ad97d031694123b628a9307c3bd.zip |
Remove pyldb_util and simply duplicate the 5-line function it contains,
rather than creating a separate shared library for it.
Diffstat (limited to 'source4/scripting')
-rw-r--r-- | source4/scripting/python/pyglue.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source4/scripting/python/pyglue.c b/source4/scripting/python/pyglue.c index c6b731ce8b..0869d2feac 100644 --- a/source4/scripting/python/pyglue.c +++ b/source4/scripting/python/pyglue.c @@ -46,6 +46,15 @@ } */\ ldb = PyLdb_AsLdbContext(py_ldb); +static void PyErr_SetLdbError(PyObject *error, int ret, struct ldb_context *ldb_ctx) +{ + if (ret == LDB_ERR_PYTHON_EXCEPTION) + return; /* Python exception should already be set, just keep that */ + + PyErr_SetObject(error, + Py_BuildValue(discard_const_p(char, "(i,s)"), ret, + ldb_ctx == NULL?ldb_strerror(ret):ldb_errstring(ldb_ctx))); +} static PyObject *py_ldb_get_exception(void) { |