A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2013-July/127396.html below:

[Python-Dev] Is it safe to call PyEval_EvalFrameEx() with an exception set?

[Python-Dev] Is it safe to call PyEval_EvalFrameEx() with an exception set? [Python-Dev] Is it safe to call PyEval_EvalFrameEx() with an exception set?Victor Stinner victor.stinner at gmail.com
Wed Jul 17 01:08:31 CEST 2013
2013/7/16 Victor Stinner <victor.stinner at gmail.com>:
> 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? The current exception can be replaced with a new
> exception.

Another example. Py_ReprLeave() function can be called while an
exception is set. I'm not sure that it is "safe" to call new code
while an exception is set.

The function can raise a new exception. For example, PyList_SetSlice()
can fail because of a MemoryError.

I modified Py_ReprLeave() to save and then restore the current exception:
http://hg.python.org/cpython/rev/28ff7ac91477

If Py_ReprLeave() raises a new exception, it is clears (replaced by
the previous exception context).

Victor
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4