diff options
author | Benjamin Peterson <benjamin@python.org> | 2013-05-16 14:37:25 -0500 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2013-05-16 14:37:25 -0500 |
commit | df197a8dcb7f4aba4ba0e6b28f910cb28088549e (patch) | |
tree | 6d8bf0825d320161ad9ac61eb8c52d2d683ec79d /Python/symtable.c | |
parent | 0b24c5b9c125ebb4f9c460cb362bfcdc6f69206f (diff) | |
download | cpython-df197a8dcb7f4aba4ba0e6b28f910cb28088549e.tar.gz |
rather than passing locals to the class body, just execute the class body in the proper environment
Diffstat (limited to 'Python/symtable.c')
-rw-r--r-- | Python/symtable.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/Python/symtable.c b/Python/symtable.c index 056c6c2858..758aefb903 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -192,7 +192,7 @@ static int symtable_visit_withitem(struct symtable *st, withitem_ty item); 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 @@ symtable_visit_stmt(struct symtable *st, stmt_ty s) 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); |