]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
use getbuiltins() everywhere, it defaults to getbuiltidict()
authorGuido van Rossum <guido@python.org>
Thu, 12 Jan 1995 11:37:57 +0000 (11:37 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 12 Jan 1995 11:37:57 +0000 (11:37 +0000)
Python/ceval.c
Python/import.c
Python/pythonrun.c

index 79874ef4d3ade35fd7d116112d244d2ed8389cc4..2d16ef8a9e9bb7cc121b9dfcbd1d1a3e2f470f2e 100644 (file)
@@ -28,6 +28,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
 #include "import.h"
 #include "sysmodule.h"
+#include "bltinmodule.h"
 #include "compile.h"
 #include "frameobject.h"
 #include "eval.h"
@@ -1691,7 +1692,7 @@ object *
 getbuiltins()
 {
        if (current_frame == NULL)
-               return NULL;
+               return getbuiltindict();
        else
                return current_frame->f_builtins;
 }
index 1d9ea35c5bfc5607ee4888c46c5a15e78bea3961..302cc259daa110e39522e29e722d6cd985250bb1 100644 (file)
@@ -149,7 +149,7 @@ exec_code_module(name, co)
                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);
index a25cbba848f1064cd1be66c2bd4eba1a1c29c8ea..11bd029a9cd3376a263c5eee9b3f787c833405aa 100644 (file)
@@ -100,7 +100,7 @@ initmain()
                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__");
        }
 }