summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Python/ast.c1
-rw-r--r--Python/compile.c6
2 files changed, 1 insertions, 6 deletions
diff --git a/Python/ast.c b/Python/ast.c
index 60906a1..1cf100e 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -354,6 +354,7 @@ static const char* FORBIDDEN[] = {
"None",
"True",
"False",
+ "__debug__",
NULL,
};
diff --git a/Python/compile.c b/Python/compile.c
index 4600589..50eb169 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -2498,12 +2498,6 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx)
PyObject *mangled;
/* XXX AugStore isn't used anywhere! */
- /* First check for assignment to __debug__. Param? */
- if ((ctx == Store || ctx == AugStore || ctx == Del)
- && !PyUnicode_CompareWithASCIIString(name, "__debug__")) {
- return compiler_error(c, "can not assign to __debug__");
- }
-
mangled = _Py_Mangle(c->u->u_private, name);
if (!mangled)
return 0;