Commits

Guido van Rossum  committed 92da890

use getbuiltins() everywhere, it defaults to getbuiltidict()

  • Participants
  • Parent commits 6954016
  • Branches legacy-trunk

Comments (0)

Files changed (3)

File Python/ceval.c

 
 #include "import.h"
 #include "sysmodule.h"
+#include "bltinmodule.h"
 #include "compile.h"
 #include "frameobject.h"
 #include "eval.h"
 getbuiltins()
 {
 	if (current_frame == NULL)
-		return NULL;
+		return getbuiltindict();
 	else
 		return current_frame->f_builtins;
 }

File Python/import.c

 		return NULL;
 	d = getmoduledict(m);
 	if (dictlookup(d, "__builtins__") == NULL) {
-		if (dictinsert(d, "__builtins__", getbuiltindict()) != 0)
+		if (dictinsert(d, "__builtins__", getbuiltins()) != 0)
 			return NULL;
 	}
 	v = eval_code((codeobject *)co, d, d, d, (object *)NULL);

File Python/pythonrun.c

 		fatal("can't create __main__ module");
 	d = getmoduledict(m);
 	if (dictlookup(d, "__builtins__") == NULL) {
-		if (dictinsert(d, "__builtins__", getbuiltindict()))
+		if (dictinsert(d, "__builtins__", getbuiltins()))
 			fatal("can't add __builtins__ to __main__");
 	}
 }