[Python-checkins] CVS: python/dist/src/Python compile.c,2.194,2.195
Jeremy Hylton
jhylton@users.sourceforge.net
2001年4月09日 09:08:02 -0700
Update of /cvsroot/python/python/dist/src/Python
In directory usw-pr-cvs1:/tmp/cvs-serv32618/Python
Modified Files:
compile.c
Log Message:
Warn when assigning to __debug__ instead of raising an error.
Index: compile.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v
retrieving revision 2.194
retrieving revision 2.195
diff -C2 -r2.194 -r2.195
*** compile.c 2001年03月23日 14:08:38 2.194
--- compile.c 2001年04月09日 16:07:59 2.195
***************
*** 5186,5196 ****
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++;
! }
symtable_add_def(st, STR(tmp), DEF_LOCAL | flag);
}
--- 5186,5191 ----
goto loop;
} else if (TYPE(tmp) == NAME) {
! if (strcmp(STR(tmp), "__debug__") == 0)
! symtable_warn(st, ASSIGN_DEBUG);
symtable_add_def(st, STR(tmp), DEF_LOCAL | flag);
}