Mercurial > cpython-lru_cache-weakref
diff Python/compile.c @ 19021:e5754f048f0b legacy-trunk
Another bug fix for recent import * warning (caught by Thomas Wouters)
Only return if symtable_warn() returns -1, indicating that the warning
was turned into an error.
| author | Jeremy Hylton <jeremy@alum.mit.edu> |
|---|---|
| date | Mon, 06 Aug 2001 20:34:25 +0000 |
| parents | 30ae3aff03bd |
| children | f20727cc3d0f |
line wrap: on
line diff
--- a/Python/compile.c Mon Aug 06 20:01:19 2001 +0000 +++ b/Python/compile.c Mon Aug 06 20:34:25 2001 +0000 @@ -5295,9 +5295,9 @@ } if (TYPE(CHILD(n, 3)) == STAR) { if (st->st_cur->ste_type != TYPE_MODULE) { - symtable_warn(st, - "import * only allowed at module level"); - return; + if (symtable_warn(st, + "import * only allowed at module level") < 0) + return; } st->st_cur->ste_optimized |= OPT_IMPORT_STAR; st->st_cur->ste_opt_lineno = n->n_lineno;
