]> granicus.if.org Git - python/commitdiff
Warn when assigning to __debug__ instead of raising an error.
authorJeremy Hylton <jeremy@alum.mit.edu>
Mon, 9 Apr 2001 16:07:59 +0000 (16:07 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Mon, 9 Apr 2001 16:07:59 +0000 (16:07 +0000)
Python/compile.c

index df514c776d95ce72fef10d011b456772b3199a37..1fb85e752ea0113be8bc651cc29a4f059f00ee36 100644 (file)
@@ -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;