Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8ebe84d commit e753ef8Copy full SHA for e753ef8
1 file changed
Python/compile.c
@@ -2354,12 +2354,15 @@ com_import_stmt(struct compiling *c, node *n)
2354
com_addopname(c, IMPORT_NAME, CHILD(subn, 0));
2355
com_push(c, 1);
2356
if (NCH(subn) > 1) {
2357
- if (strcmp(STR(CHILD(subn, 1)), "as") != 0 ||
2358
- NCH(CHILD(subn, 0)) > 1) {
+ int j;
+ if (strcmp(STR(CHILD(subn, 1)), "as") != 0) {
2359
com_error(c, PyExc_SyntaxError,
2360
"invalid syntax");
2361
return;
2362
}
2363
+ for (j=2 ; j < NCH(CHILD(subn, 0)); j += 2)
2364
+ com_addopname(c, LOAD_ATTR,
2365
+ CHILD(CHILD(subn, 0), j));
2366
com_addopname(c, STORE_NAME, CHILD(subn, 2));
2367
} else
2368
com_addopname(c, STORE_NAME,
0 commit comments