diff options
author | Benjamin Peterson <benjamin@python.org> | 2011-06-19 19:42:22 -0500 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2011-06-19 19:42:22 -0500 |
commit | ffc361118f1250d4c960b2c8d0ff469de0d0b259 (patch) | |
tree | 27e28ae9b0fae7c7381433c75dfcefb9f1e4bab7 /Python/compile.c | |
parent | 8b5b2ae940588f9314fc97a63a0c94da7879cfd0 (diff) | |
download | cpython-ffc361118f1250d4c960b2c8d0ff469de0d0b259.tar.gz |
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 b655c2523a..567b2302a9 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; |