summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-11-04 19:36:18 (GMT)
committerGuido van Rossum <guido@python.org>1997-11-04 19:36:18 (GMT)
commit4a1f39a26bd5ff97f0388b2a35ea6edf089a0e07 (patch)
treeabd6e36842fe639c17491ad0d2df982f074660e8 /Python
parent6d48c4a00b4a6846251dbb84acc24872ee52ce4b (diff)
downloadcpython-4a1f39a26bd5ff97f0388b2a35ea6edf089a0e07.zip
cpython-4a1f39a26bd5ff97f0388b2a35ea6edf089a0e07.tar.gz
cpython-4a1f39a26bd5ff97f0388b2a35ea6edf089a0e07.tar.bz2
Undo half of the previous change :-(
Setting interp->builtins to the __builtin__ module instead of to its dictionary had the unfortunate side effect of always running in restricted execution mode :-( I will check in a different way of setting __main__.__builtins__ to the __builtin__ module later. Also, there was a typo -- a comment was unfinished, and as a result some finalizations were not being executed. In Bart Simpson style, I Will Not Check In Untested Changes. I Will Not Check In Untested Changes. I Will Not Check In Untested Changes. I Will Not Check In Untested Changes. I Will Not Check In Untested Changes. I Will Not Check In Untested Changes. I Will Not Check In Untested Changes. I Will Not Check In Untested Changes. I Will Not Check In Untested Changes. I Will Not Check In Untested Changes.
Diffstat (limited to 'Python')
-rw-r--r--Python/pythonrun.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 15161f8..381c987 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -77,7 +77,6 @@ int Py_VerboseFlag; /* Needed by import.c */
int Py_InteractiveFlag; /* Needed by Py_FdIsInteractive() below */
int Py_NoSiteFlag; /* Suppress 'import site' */
int Py_UseClassExceptionsFlag = 1; /* Needed by bltinmodule.c */
-int Py_UsingLocale = 0; /* needed by compile.c, modified by localemodule */
static int initialized = 0;
@@ -134,8 +133,8 @@ Py_Initialize()
bimod = _PyBuiltin_Init_1();
if (bimod == NULL)
Py_FatalError("Py_Initialize: can't initialize __builtin__");
- Py_INCREF(bimod);
- interp->builtins = bimod;
+ interp->builtins = PyModule_GetDict(bimod);
+ Py_INCREF(interp->builtins);
sysmod = _PySys_Init();
if (sysmod == NULL)
@@ -148,7 +147,7 @@ Py_Initialize()
interp->modules);
/* phase 2 of builtins */
- _PyBuiltin_Init_2(PyModule_GetDict(bimod));
+ _PyBuiltin_Init_2(interp->builtins);
_PyImport_FixupExtension("__builtin__", "__builtin__");
_PyImport_Init();
@@ -199,7 +198,7 @@ Py_Finalize()
/* Destroy all modules */
PyImport_Cleanup();
- /* Delete current thread
+ /* Delete current thread */
PyInterpreterState_Clear(interp);
PyThreadState_Swap(NULL);
PyInterpreterState_Delete(interp);
@@ -287,8 +286,8 @@ Py_NewInterpreter()
bimod = _PyImport_FindExtension("__builtin__", "__builtin__");
if (bimod != NULL) {
- Py_INCREF(bimod);
- interp->builtins = bimod;
+ interp->builtins = PyModule_GetDict(bimod);
+ Py_INCREF(interp->builtins);
}
sysmod = _PyImport_FindExtension("sys", "sys");
if (bimod != NULL && sysmod != NULL) {