[Jeremy Hylton]
> I was wondering today how I could convince myself that a sequence of
> Py_CLEAR() calls in a tp_clear function was safe. Take for example a
> really trivial sequence of code on frame_clear():
>
> Py_CLEAR(f->f_exc_type);
> Py_CLEAR(f->f_exc_value);
> Py_CL
On 2/12/07, Guido van Rossum <[EMAIL PROTECTED]> wrote:
> Looking for where tp_clear() is being called, the only caller is line
> 713 in gmodule.c, which explicitly surrounds the call with an
> INCREF/DECREF pair. Perhaps that's the clue you're looking for?
Yes, of course. The INCREF guarantees t
Looking for where tp_clear() is being called, the only caller is line
713 in gmodule.c, which explicitly surrounds the call with an
INCREF/DECREF pair. Perhaps that's the clue you're looking for?
--Guido
On 2/12/07, Jeremy Hylton <[EMAIL PROTECTED]> wrote:
> I was wondering today how I could conv
I was wondering today how I could convince myself that a sequence of
Py_CLEAR() calls in a tp_clear function was safe. Take for example a
really trivial sequence of code on frame_clear():
Py_CLEAR(f->f_exc_type);
Py_CLEAR(f->f_exc_value);
Py_CLEAR(f->f_exc_traceback);