PyErr_LDB_ERROR_IS_ERR_RAISE
Michael Wood
esiotrot at gmail.com
Thu Mar 1 23:26:45 MST 2012
On 1 March 2012 22:32, Jelmer Vernooij <jelmer at samba.org> wrote:
> Am 29/02/12 16:24, schrieb Julia Lawall:
>
>> It is probably not vary important, but the following code in
>> source4/lib/ldb/pyldb.c is a bit sloppy:
This file was moved to lib/ldb/pyldb.c in July last year. Are you
working off samba-4.0.0alpha16?
>>
>> if (ret != LDB_SUCCESS) {
>> PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ret,
>> ldb_ctx);
>> talloc_free(mem_ctx);
>> return NULL;
>> }
>>
>> PyErr_LDB_ERROR_IS_ERR_RAISE tests ret again in the same way and if
>> the test succeeds returns, making the rest dead code.
>
> PyErr_LDB_ERROR_IS_ERR_RAISE is unnecessary in this case, as it is itself a
> wrapper that only returns in case ret != LDB_SUCCESS.
I believe that is what she was saying :)
--
Michael Wood <esiotrot at gmail.com>
More information about the samba-technical
mailing list