diff options
author | Sjoerd Mullender <sjoerd@acm.org> | 1995-04-04 11:47:41 (GMT) |
---|---|---|
committer | Sjoerd Mullender <sjoerd@acm.org> | 1995-04-04 11:47:41 (GMT) |
commit | 5b7f3cd3e17b96d3ef505cc46df169caab06c784 (patch) | |
tree | 3256af82c80d89a96aaf48195009526c02fde142 | |
parent | f9adf48750fc9cbfbb8c71275b4b337ffc7d9b51 (diff) | |
download | cpython-5b7f3cd3e17b96d3ef505cc46df169caab06c784.zip cpython-5b7f3cd3e17b96d3ef505cc46df169caab06c784.tar.gz cpython-5b7f3cd3e17b96d3ef505cc46df169caab06c784.tar.bz2 |
Use mappinglookup instead of dictlookup for looking up __builtin__.
-rw-r--r-- | Objects/frameobject.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Objects/frameobject.c b/Objects/frameobject.c index beb4c2d..db02924 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -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)) { |