diff options
-rw-r--r-- | Objects/frameobject.c | 2 | ||||
-rw-r--r-- | Python/ceval.c | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/Objects/frameobject.c b/Objects/frameobject.c index 52b4e52..beb4c2d 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -149,6 +149,8 @@ newframeobject(back, code, globals, locals, owner, nvalues, nblocks) return NULL; } builtins = dictlookup(globals, "__builtins__"); + if (builtins != NULL && is_moduleobject(builtins)) + builtins = getmoduledict(builtins); if (builtins == NULL || !is_mappingobject(builtins)) { err_setstr(TypeError, "bad __builtins__ dictionary"); return NULL; diff --git a/Python/ceval.c b/Python/ceval.c index 2d16ef8..08758eb 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -737,8 +737,8 @@ eval_code(co, globals, locals, owner, arg) !suppress_print) { flushline(); x = sysget("stdout"); - softspace(x, 1); err = writeobject(v, x, 0); + softspace(x, 1); flushline(); } DECREF(v); @@ -1692,7 +1692,7 @@ object * getbuiltins() { if (current_frame == NULL) - return getbuiltindict(); + return getbuiltinmod(); else return current_frame->f_builtins; } |