STINNER Victor <vstin...@redhat.com> added the comment:
Stefan Behnel: "I added this assertion exactly for the purpose of finding this
kind of bug. It means that some code tried to look up an attribute with a live
exception set, which previously could swallow the exception in certain
situations, and even if not, it is always the wrong thing to do."
The assertion failure is a little bit "far" from the bug: would it make sense
to add "assert(!PyErr_Occurred());" to the entry point of:
* and other similar functions?
A few years ago, I added "assert(!PyErr_Occurred());" to the entry point of C
functions which can call arbitrary code like _PyEval_EvalFrameDefault(),
PyObject_Call(), etc. It helped to find many bugs.
Python tracker <rep...@bugs.python.org>
Python-bugs-list mailing list