Warn when assigning to __debug__ instead of raising an error.
diff --git a/Python/compile.c b/Python/compile.c
index df514c7..1fb85e7 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -5185,13 +5185,8 @@
n = CHILD(n, 1);
goto loop;
} else if (TYPE(tmp) == NAME) {
- if (strcmp(STR(tmp), "__debug__") == 0) {
- PyErr_SetString(PyExc_SyntaxError,
- ASSIGN_DEBUG);
- PyErr_SyntaxLocation(st->st_filename,
- n->n_lineno);
- st->st_errors++;
- }
+ if (strcmp(STR(tmp), "__debug__") == 0)
+ symtable_warn(st, ASSIGN_DEBUG);
symtable_add_def(st, STR(tmp), DEF_LOCAL | flag);
}
return;