summaryrefslogtreecommitdiffstats
path: root/Python/symtable.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/symtable.c')
-rw-r--r--Python/symtable.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Python/symtable.c b/Python/symtable.c
index fd902bf..47fdad2 100644
--- a/Python/symtable.c
+++ b/Python/symtable.c
@@ -1471,10 +1471,10 @@ symtable_visit_alias(struct symtable *st, alias_ty a)
else {
if (st->st_cur->ste_type != ModuleBlock) {
int lineno = st->st_cur->ste_lineno;
- if (!symtable_warn(st, IMPORT_STAR_WARNING, lineno)) {
- Py_DECREF(store_name);
- return 0;
- }
+ PyErr_SetString(PyExc_SyntaxError, IMPORT_STAR_WARNING);
+ PyErr_SyntaxLocation(st->st_filename, lineno);
+ Py_DECREF(store_name);
+ return 0;
}
st->st_cur->ste_unoptimized |= OPT_IMPORT_STAR;
Py_DECREF(store_name);