Commits

Anonymous committed 5fd8524

different init for __builtins__

Comments (0)

Files changed (2)

Objects/frameobject.c

 		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;
 			    !suppress_print) {
 				flushline();
 				x = sysget("stdout");
+				err = writeobject(v, x, 0);
 				softspace(x, 1);
-				err = writeobject(v, x, 0);
 				flushline();
 			}
 			DECREF(v);
 getbuiltins()
 {
 	if (current_frame == NULL)
-		return getbuiltindict();
+		return getbuiltinmod();
 	else
 		return current_frame->f_builtins;
 }