diff options
author | Guido van Rossum <guido@python.org> | 1995-01-09 17:53:26 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1995-01-09 17:53:26 (GMT) |
commit | 6135a87f2b1474be6caf1bf776024d0c6d10a6d1 (patch) | |
tree | e0b23d5b7b9587a76917894a601f311514c80a8b /Python/import.c | |
parent | 2565bff40a6d7d06c29b7d7a7a580f78b1d4f169 (diff) | |
download | cpython-6135a87f2b1474be6caf1bf776024d0c6d10a6d1.zip cpython-6135a87f2b1474be6caf1bf776024d0c6d10a6d1.tar.gz cpython-6135a87f2b1474be6caf1bf776024d0c6d10a6d1.tar.bz2 |
__builtins__ mods (and sys_checkinterval for ceval.c)
Diffstat (limited to 'Python/import.c')
-rw-r--r-- | Python/import.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Python/import.c b/Python/import.c index ef24883..1d9ea35 100644 --- a/Python/import.c +++ b/Python/import.c @@ -32,6 +32,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "import.h" #include "errcode.h" #include "sysmodule.h" +#include "bltinmodule.h" #include "pythonrun.h" #include "marshal.h" #include "compile.h" @@ -147,6 +148,10 @@ exec_code_module(name, co) if (m == NULL) return NULL; d = getmoduledict(m); + if (dictlookup(d, "__builtins__") == NULL) { + if (dictinsert(d, "__builtins__", getbuiltindict()) != 0) + return NULL; + } v = eval_code((codeobject *)co, d, d, d, (object *)NULL); if (v == NULL) return NULL; |