diff Python/compile.c @ 70889:2d62ee4e7d98

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)
author Benjamin Peterson <benjamin@python.org>
date Sun, 19 Jun 2011 19:42:22 -0500
parents e0e663132363
children 8beaa9a37387
line wrap: on
line diff
--- a/Python/compile.c	Sun Jun 19 17:49:22 2011 -0500
+++ b/Python/compile.c	Sun Jun 19 19:42:22 2011 -0500
@@ -1566,7 +1566,7 @@
             return 0;
         }
         /* return the (empty) __class__ cell */
-        str = PyUnicode_InternFromString("__class__");
+        str = PyUnicode_InternFromString("@__class__");
         if (str == NULL) {
             compiler_exit_scope(c);
             return 0;