]> granicus.if.org Git - python/commitdiff
*Don't* kill all local variables on function exit. This will be done
authorGuido van Rossum <guido@python.org>
Fri, 14 Feb 1997 16:32:14 +0000 (16:32 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 14 Feb 1997 16:32:14 +0000 (16:32 +0000)
by the frameobject dealloc when it is time for the locals to go.  When
there's still a traceback object referencing this stack frame, we
don't want the local variables to disappear yet.

(Hmm...  Shouldn't they be copied to the f_locals dictionary?)

Python/ceval.c

index 65aad61def9b029fdb02b0ff053bcb2ac19d24db..37a41687fbb5260493c3dc10a36f12cf93d73e1e 100644 (file)
@@ -1709,18 +1709,6 @@ eval_code2(co, globals, locals,
        --recursion_depth;
 
   fail: /* Jump here from prelude on failure */
-
-       /* Kill all local variables */
-
-       {
-               int i;
-               for (i = co->co_nlocals; --i >= 0; ++fastlocals) {
-                       if (*fastlocals != NULL) {
-                               DECREF(*fastlocals);
-                               *fastlocals = NULL;
-                       }
-               }
-       }
        
        /* Restore previous frame and release the current one */