Mercurial > cpython-lru_cache-weakref
diff Python/compile.c @ 49696:2e0857b0fc67 legacy-trunk
check for assignment to __debug__ during AST generation
Also, give assignment to None a better error message
| author | Benjamin Peterson <benjamin@python.org> |
|---|---|
| date | Sat, 08 Nov 2008 18:38:54 +0000 |
| parents | 1c964ed35ef9 |
| children | 94e79d78dff0 |
line wrap: on
line diff
--- a/Python/compile.c Sat Nov 08 17:07:06 2008 +0000 +++ b/Python/compile.c Sat Nov 08 18:38:54 2008 +0000 @@ -2344,12 +2344,6 @@ PyObject *mangled; /* XXX AugStore isn't used anywhere! */ - /* First check for assignment to __debug__. Param? */ - if ((ctx == Store || ctx == AugStore || ctx == Del) - && !strcmp(PyString_AS_STRING(name), "__debug__")) { - return compiler_error(c, "can not assign to __debug__"); - } - mangled = _Py_Mangle(c->u->u_private, name); if (!mangled) return 0;
