]> git.ipfire.org Git - thirdparty/samba.git/commit
pyldb: use PyErr_LDB_MESSAGE_OR_RAISE() in various functions
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Fri, 15 Mar 2024 00:08:03 +0000 (13:08 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 10 Apr 2024 05:13:32 +0000 (05:13 +0000)
commitbc45a258d2a4442ff7294cd6cdadd6f780a06cd4
treeb75b0f55526246fc75f484dba68e2cf43219a10b
parentf0e665f4a9accad5b8814e27553010645b9feddb
pyldb: use PyErr_LDB_MESSAGE_OR_RAISE() in various functions

In these simple cases, we are:

1. replacing the first argument `PyObject *` with `PyLdbMessageObject *`.
2. adding a `struct ldb_message *msg = NULL;` variable.
3. `PyErr_LDB_MESSAGE_OR_RAISE(self, msg);`.
4. changing the `self->msg` to `msg`.
5. adding { } to the `if (!PyArg_ParseTuple() return NULL;`.
6. replacing `self->pyldb` with `pyldb_Message_get_pyldb(self)`

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