diff options
author | Benjamin Peterson <benjamin@python.org> | 2011-06-20 00:42:22 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2011-06-20 00:42:22 (GMT) |
commit | f5ff22329b3a4838054dfadfad74fc5a0519cbb2 (patch) | |
tree | cbf644106089a69d028c954e246dab129b3d02cd /Python/compile.c | |
parent | 019d0f27a3fc8d4daa7caea8c041cd26d5873950 (diff) | |
download | cpython-f5ff22329b3a4838054dfadfad74fc5a0519cbb2.zip cpython-f5ff22329b3a4838054dfadfad74fc5a0519cbb2.tar.gz cpython-f5ff22329b3a4838054dfadfad74fc5a0519cbb2.tar.bz2 |
use a invalid name for the __class__ closure for super() (closes #12370)
This prevents the assignment of __class__ in the class body from breaking
super. (Although a determined person could do locals()["@__class__"] = 4)
Diffstat (limited to 'Python/compile.c')
-rw-r--r-- | Python/compile.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/compile.c b/Python/compile.c index b655c25..567b230 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -1566,7 +1566,7 @@ compiler_class(struct compiler *c, stmt_ty s) return 0; } /* return the (empty) __class__ cell */ - str = PyUnicode_InternFromString("__class__"); + str = PyUnicode_InternFromString("@__class__"); if (str == NULL) { compiler_exit_scope(c); return 0; |