diff Python/compile.c @ 17355:4468a8da67ca legacy-trunk

Warn when assigning to __debug__ instead of raising an error.
author Jeremy Hylton <jeremy@alum.mit.edu>
date Mon, 09 Apr 2001 16:07:59 +0000
parents f9a30015e8b0
children f939ce52a734
line wrap: on
line diff
--- a/Python/compile.c	Mon Apr 09 15:57:06 2001 +0000
+++ b/Python/compile.c	Mon Apr 09 16:07:59 2001 +0000
@@ -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;