Code review comment for lp:~jameinel/bzr/2.1-simple-set

Revision history for this message
Andrew Bennetts (spiv) wrote :

John A Meinel wrote:
[...]
> So it turns out that this fix actually causes crazy corruption. Specifically
>
> assert PyObject_IsTrue(Py_NotImplemented)
>
> passes.

Ah, yes, it would.

[...]
> So the code was doing:
>
> if res == NULL:
> return -1
> if PyObject_IsTrue(res):
> ...
> if res == Py_NotImplemented:
> # reverse the comparison.
>

So I guess you need to change this to:

if res == NULL:
    return -1
elif res == Py_NotImplemented:
    # reverse the comparison
    ...
elif PyObject_IsTrue(res):
    ...

And similarly for handling the res of the reversed comparison.

-Andrew.

« Back to merge proposal