Le Tue, 16 Jul 2013 02:34:49 +0200,
Victor Stinner <victor.stin...@gmail.com> a écrit :
> Hi,
> 
> I'm working on the issue #18408 (fix issues found by my pyfailmalloc
> tool). To analyze some bugs, I have to add debug traces in various
> functions to find which function returned NULL without setting an
> error, or the opposite: returned a valid object, but with an exception
> set.
> 
> I would like to add assertions in Python/ceval.c to detect such bugs
> earlier. The problem is that some functions rely on the ability to
> call PyEval_EvalFrameEx() with an exception set. Is it expected?
> Should it be avoided?

Well, if your frame is a generator frame, you must be able to throw()
into it, i.e. resume it with an exception set.

The difficulty here is that there are different meanings for "an
exception is set":
- PyErr_Occurred() is true
- the f_exc_type field and friends are set
- possibly another one that I'm forgetting about

Regards

Antoine.


_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to