diff Python/symtable.c @ 83791:6db3741e59be

rather than passing locals to the class body, just execute the class body in the proper environment
author Benjamin Peterson <benjamin@python.org>
date Thu, 16 May 2013 14:37:25 -0500
parents e74f4d6c0c81
children 8bcdd2343bf5
line wrap: on
line diff
--- a/Python/symtable.c	Thu May 16 12:03:40 2013 -0500
+++ b/Python/symtable.c	Thu May 16 14:37:25 2013 -0500
@@ -192,7 +192,7 @@
 
 static identifier top = NULL, lambda = NULL, genexpr = NULL,
     listcomp = NULL, setcomp = NULL, dictcomp = NULL,
-    __class__ = NULL, __locals__ = NULL;
+    __class__ = NULL;
 
 #define GET_IDENTIFIER(VAR) \
     ((VAR) ? (VAR) : ((VAR) = PyUnicode_InternFromString(# VAR)))
@@ -1185,11 +1185,6 @@
         if (!symtable_enter_block(st, s->v.ClassDef.name, ClassBlock,
                                   (void *)s, s->lineno, s->col_offset))
             VISIT_QUIT(st, 0);
-        if (!GET_IDENTIFIER(__locals__) ||
-            !symtable_add_def(st, __locals__, DEF_PARAM)) {
-            symtable_exit_block(st, s);
-            VISIT_QUIT(st, 0);
-        }
         tmp = st->st_private;
         st->st_private = s->v.ClassDef.name;
         VISIT_SEQ(st, stmt, s->v.ClassDef.body);