summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2001-08-06 20:34:25 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2001-08-06 20:34:25 (GMT)
commit6a53bd858216f24688a7cd9a7e6482b7f223a288 (patch)
tree361c0dfe92d5ba46253b14c9c4f5683b64899fe1 /Python/compile.c
parentae5262ef324c3f6578f71ff42bd1b05693fc0df0 (diff)
downloadcpython-6a53bd858216f24688a7cd9a7e6482b7f223a288.zip
cpython-6a53bd858216f24688a7cd9a7e6482b7f223a288.tar.gz
cpython-6a53bd858216f24688a7cd9a7e6482b7f223a288.tar.bz2
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.
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Python/compile.c b/Python/compile.c
index a30d663..31a75bd 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -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;