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.
John A Meinel wrote: IsTrue( Py_NotImplement ed)
[...]
> So it turns out that this fix actually causes crazy corruption. Specifically
>
> assert PyObject_
>
> passes.
Ah, yes, it would.
[...] IsTrue( res):
> So the code was doing:
>
> if res == NULL:
> return -1
> if PyObject_
> ...
> if res == Py_NotImplemented:
> # reverse the comparison.
>
So I guess you need to change this to:
if res == NULL: IsTrue( res):
return -1
elif res == Py_NotImplemented:
# reverse the comparison
...
elif PyObject_
...
And similarly for handling the res of the reversed comparison.
-Andrew.