]> granicus.if.org Git - python/commitdiff
Another bug fix for recent import * warning (caught by Thomas Wouters)
authorJeremy Hylton <jeremy@alum.mit.edu>
Mon, 6 Aug 2001 20:34:25 +0000 (20:34 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Mon, 6 Aug 2001 20:34:25 +0000 (20:34 +0000)
Only return if symtable_warn() returns -1, indicating that the warning
was turned into an error.

Python/compile.c

index a30d663219f3fc08f25b2cb49689605979bd72da..31a75bd3b1dc7f504cd0dadc142eeaa55914eadd 100644 (file)
@@ -5295,9 +5295,9 @@ 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 * 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;