PyErr_LDB_ERROR_IS_ERR_RAISE

Julia Lawall julia.lawall at lip6.fr
Thu Mar 1 23:48:27 MST 2012


On Fri, 2 Mar 2012, Michael Wood wrote:

> 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?

Indeed, when I sent the email I was looking at that version.  I also 
checked the latest git version, and there was the same problem, but only 
in this file.

julia

>>>
>>>        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