summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 47445d0..7316790 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -2139,7 +2139,8 @@ com_import_stmt(struct compiling *c, node *n)
com_addopname(c, IMPORT_NAME, CHILD(subn, 0));
com_push(c, 1);
if (NCH(subn) > 1) {
- if (strcmp(STR(CHILD(subn, 1)), "as") != 0) {
+ if (strcmp(STR(CHILD(subn, 1)), "as") != 0 ||
+ NCH(CHILD(subn, 0)) > 1) {
com_error(c, PyExc_SyntaxError,
"invalid syntax");
return;