mirror of https://github.com/python/cpython
Fix error message for import * in function/class scope
This commit is contained in:
parent
8a6f295303
commit
ba591bf3bd
|
@ -5296,7 +5296,7 @@ symtable_import(struct symtable *st, node *n)
|
||||||
if (TYPE(CHILD(n, 3)) == STAR) {
|
if (TYPE(CHILD(n, 3)) == STAR) {
|
||||||
if (st->st_cur->ste_type != TYPE_MODULE) {
|
if (st->st_cur->ste_type != TYPE_MODULE) {
|
||||||
symtable_warn(st,
|
symtable_warn(st,
|
||||||
"import * not allowed inside function");
|
"import * only allowed at module level");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
st->st_cur->ste_optimized |= OPT_IMPORT_STAR;
|
st->st_cur->ste_optimized |= OPT_IMPORT_STAR;
|
||||||
|
|
Loading…
Reference in New Issue