mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
Move exc state to generator. Fixes bpo-25612 (#1773)
Move exception state information from frame objects to coroutine (generator/thread) object where it belongs.
This commit is contained in:
parent
91dc64ba3f
commit
ae3087c638
13 changed files with 188 additions and 164 deletions
|
@ -30,14 +30,6 @@ typedef struct _frame {
|
|||
char f_trace_lines; /* Emit per-line trace events? */
|
||||
char f_trace_opcodes; /* Emit per-opcode trace events? */
|
||||
|
||||
/* In a generator, we need to be able to swap between the exception
|
||||
state inside the generator and the exception state of the calling
|
||||
frame (which shouldn't be impacted when the generator "yields"
|
||||
from an except handler).
|
||||
These three fields exist exactly for that, and are unused for
|
||||
non-generator frames. See the save_exc_state and swap_exc_state
|
||||
functions in ceval.c for details of their use. */
|
||||
PyObject *f_exc_type, *f_exc_value, *f_exc_traceback;
|
||||
/* Borrowed reference to a generator, or NULL */
|
||||
PyObject *f_gen;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue