summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1991-08-16 08:58:43 (GMT)
committerGuido van Rossum <guido@python.org>1991-08-16 08:58:43 (GMT)
commit831632507a47eb5050d1f02fcb9f26aa1b1c6855 (patch)
tree5508891761d737f4a8f12b4daa2d47a0fecf3e68 /Python/compile.c
parent670690e2aad728aeac7d9fd496002e4b3b49a159 (diff)
downloadcpython-831632507a47eb5050d1f02fcb9f26aa1b1c6855.zip
cpython-831632507a47eb5050d1f02fcb9f26aa1b1c6855.tar.gz
cpython-831632507a47eb5050d1f02fcb9f26aa1b1c6855.tar.bz2
Use dmore dict2lookup.
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 4dc3d9f..8366333 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -1950,10 +1950,13 @@ optimizer(co)
oparg = NEXTARG();
if (opcode == LOAD_NAME) {
name = GETNAMEOBJ(oparg);
- if (dictlookup(locals, getstringvalue(name)) != NULL)
+ if (dict2lookup(locals, name) != NULL)
*cur_instr = LOAD_LOCAL;
- else if (!star_used)
- *cur_instr = LOAD_GLOBAL;
+ else {
+ err_clear();
+ if (!star_used)
+ *cur_instr = LOAD_GLOBAL;
+ }
}
}