Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8316325

Browse files
committed
Use dmore dict2lookup.
1 parent 670690e commit 8316325

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

Python/compile.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1950,10 +1950,13 @@ optimizer(co)
19501950
oparg = NEXTARG();
19511951
if (opcode == LOAD_NAME) {
19521952
name = GETNAMEOBJ(oparg);
1953-
if (dictlookup(locals, getstringvalue(name)) != NULL)
1953+
if (dict2lookup(locals, name) != NULL)
19541954
*cur_instr = LOAD_LOCAL;
1955-
else if (!star_used)
1956-
*cur_instr = LOAD_GLOBAL;
1955+
else {
1956+
err_clear();
1957+
if (!star_used)
1958+
*cur_instr = LOAD_GLOBAL;
1959+
}
19571960
}
19581961
}
19591962

0 commit comments

Comments
 (0)