mirror of
https://github.com/python/cpython
synced 2026-09-29 11:35:29 +03:00
__builtins__ mods (and sys_checkinterval for ceval.c)
This commit is contained in:
parent
2565bff40a
commit
6135a87f2b
8 changed files with 90 additions and 45 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue