[Python-checkins] CVS: python/dist/src/Python compile.c,2.208,2.209
Jeremy Hylton
jhylton@users.sourceforge.net
2001年8月06日 12:45:42 -0700
Update of /cvsroot/python/python/dist/src/Python
In directory usw-pr-cvs1:/tmp/cvs-serv3254
Modified Files:
compile.c
Log Message:
Fix SF bug [ #445474 ] warn about import * inside functions
Reported by the Man himself.
Index: compile.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v
retrieving revision 2.208
retrieving revision 2.209
diff -C2 -d -r2.208 -r2.209
*** compile.c 2001年07月16日 16:53:08 2.208
--- compile.c 2001年08月06日 19:45:40 2.209
***************
*** 5295,5298 ****
--- 5295,5303 ----
}
if (TYPE(CHILD(n, 3)) == STAR) {
+ if (st->st_cur->ste_type != TYPE_MODULE) {
+ symtable_warn(st,
+ "import * not allowed inside function");
+ return;
+ }
st->st_cur->ste_optimized |= OPT_IMPORT_STAR;
st->st_cur->ste_opt_lineno = n->n_lineno;