summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2013-08-05 21:26:40 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2013-08-05 21:26:40 (GMT)
commit58720d6145eca69b9aa45b720cb3c1376b1ddaea (patch)
tree56a90729aff1127491b8f895b40b4159ca3dce56 /Python
parentc53204b9477a2e28b6b366fd271f61c73b805cee (diff)
downloadcpython-58720d6145eca69b9aa45b720cb3c1376b1ddaea.zip
cpython-58720d6145eca69b9aa45b720cb3c1376b1ddaea.tar.gz
cpython-58720d6145eca69b9aa45b720cb3c1376b1ddaea.tar.bz2
Issue #17934: Add a clear() method to frame objects, to help clean up expensive details (local variables) and break reference cycles.
Diffstat (limited to 'Python')
-rw-r--r--Python/ceval.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 837b7c1..465876b 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -1182,6 +1182,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
stack_pointer = f->f_stacktop;
assert(stack_pointer != NULL);
f->f_stacktop = NULL; /* remains NULL unless yield suspends frame */
+ f->f_executing = 1;
if (co->co_flags & CO_GENERATOR && !throwflag) {
if (f->f_exc_type != NULL && f->f_exc_type != Py_None) {
@@ -3206,6 +3207,7 @@ fast_yield:
/* pop frame */
exit_eval_frame:
Py_LeaveRecursiveCall();
+ f->f_executing = 0;
tstate->frame = f->f_back;
return retval;