diff options
Diffstat (limited to 'Python/ast.c')
-rw-r--r-- | Python/ast.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/ast.c b/Python/ast.c index 29b0e829d4..6eb3aa4110 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -130,7 +130,9 @@ static int forbidden_check(struct compiling *c, const node *n, const char *x) { if (!strcmp(x, "None")) - return ast_error(n, "assignment to None"); + return ast_error(n, "cannot assign to None"); + if (!strcmp(x, "__debug__")) + return ast_error(n, "cannot assign to __debug__"); if (Py_Py3kWarningFlag) { if (!(strcmp(x, "True") && strcmp(x, "False")) && !ast_warn(c, n, "assignment to True or False is forbidden in 3.x")) |