diff Python/ceval.c @ 85046:862ab99ab570

Issue #17934: Add a clear() method to frame objects, to help clean up expensive details (local variables) and break reference cycles.
author Antoine Pitrou <solipsis@pitrou.net>
date Mon, 05 Aug 2013 23:26:40 +0200
parents 29c6fe41e7f1
children e7f6cef7a4cc
line wrap: on
line diff
--- a/Python/ceval.c	Mon Aug 05 23:17:30 2013 +0200
+++ b/Python/ceval.c	Mon Aug 05 23:26:40 2013 +0200
@@ -1182,6 +1182,7 @@
     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 @@
     /* pop frame */
 exit_eval_frame:
     Py_LeaveRecursiveCall();
+    f->f_executing = 0;
     tstate->frame = f->f_back;
 
     return retval;