summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2001-04-09 16:07:59 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2001-04-09 16:07:59 (GMT)
commita830b3859baafd78964f98c7587b3bd7da6ba6ae (patch)
tree0c1bed9ab5c0da9c09ba6d9839c65ba122a4dcf9 /Python
parent819815abeac2c2197833ee5ef313db376e31f57f (diff)
downloadcpython-a830b3859baafd78964f98c7587b3bd7da6ba6ae.zip
cpython-a830b3859baafd78964f98c7587b3bd7da6ba6ae.tar.gz
cpython-a830b3859baafd78964f98c7587b3bd7da6ba6ae.tar.bz2
Warn when assigning to __debug__ instead of raising an error.
Diffstat (limited to 'Python')
-rw-r--r--Python/compile.c9
1 files changed, 2 insertions, 7 deletions
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 @@ symtable_assign(struct symtable *st, node *n, int flag)
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;