Kaydet (Commit) 5b7f3cd3 authored tarafından Sjoerd Mullender's avatar Sjoerd Mullender

Use mappinglookup instead of dictlookup for looking up __builtin__.

üst f9adf487
......@@ -138,8 +138,14 @@ newframeobject(back, code, globals, locals, owner, nvalues, nblocks)
int nvalues;
int nblocks;
{
static object *builtin_object;
frameobject *f;
object *builtins;
if (builtin_object == NULL) {
builtin_object = newstringobject("__builtins__");
if (builtin_object == NULL)
return NULL;
}
if ((back != NULL && !is_frameobject(back)) ||
code == NULL || !is_codeobject(code) ||
globals == NULL || !is_dictobject(globals) ||
......@@ -148,7 +154,7 @@ newframeobject(back, code, globals, locals, owner, nvalues, nblocks)
err_badcall();
return NULL;
}
builtins = dictlookup(globals, "__builtins__");
builtins = mappinglookup(globals, builtin_object);
if (builtins != NULL && is_moduleobject(builtins))
builtins = getmoduledict(builtins);
if (builtins == NULL || !is_mappingobject(builtins)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment