Commit 8a6f2953 authored by Jeremy Hylton's avatar Jeremy Hylton

Fix SF bug [ #445474 ] warn about import * inside functions

Reported by the Man himself.
parent 5dd064aa
......@@ -5294,6 +5294,11 @@ symtable_import(struct symtable *st, node *n)
}
}
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;
} else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment