mirror of
https://github.com/python/cpython.git
synced 2025-11-02 11:08:57 +00:00
use getbuiltins() everywhere, it defaults to getbuiltidict()
This commit is contained in:
parent
922d8ff803
commit
94390ec2a6
3 changed files with 4 additions and 3 deletions
|
|
@ -28,6 +28,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
#include "import.h"
|
#include "import.h"
|
||||||
#include "sysmodule.h"
|
#include "sysmodule.h"
|
||||||
|
#include "bltinmodule.h"
|
||||||
#include "compile.h"
|
#include "compile.h"
|
||||||
#include "frameobject.h"
|
#include "frameobject.h"
|
||||||
#include "eval.h"
|
#include "eval.h"
|
||||||
|
|
@ -1691,7 +1692,7 @@ object *
|
||||||
getbuiltins()
|
getbuiltins()
|
||||||
{
|
{
|
||||||
if (current_frame == NULL)
|
if (current_frame == NULL)
|
||||||
return NULL;
|
return getbuiltindict();
|
||||||
else
|
else
|
||||||
return current_frame->f_builtins;
|
return current_frame->f_builtins;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -149,7 +149,7 @@ exec_code_module(name, co)
|
||||||
return NULL;
|
return NULL;
|
||||||
d = getmoduledict(m);
|
d = getmoduledict(m);
|
||||||
if (dictlookup(d, "__builtins__") == NULL) {
|
if (dictlookup(d, "__builtins__") == NULL) {
|
||||||
if (dictinsert(d, "__builtins__", getbuiltindict()) != 0)
|
if (dictinsert(d, "__builtins__", getbuiltins()) != 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
v = eval_code((codeobject *)co, d, d, d, (object *)NULL);
|
v = eval_code((codeobject *)co, d, d, d, (object *)NULL);
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ initmain()
|
||||||
fatal("can't create __main__ module");
|
fatal("can't create __main__ module");
|
||||||
d = getmoduledict(m);
|
d = getmoduledict(m);
|
||||||
if (dictlookup(d, "__builtins__") == NULL) {
|
if (dictlookup(d, "__builtins__") == NULL) {
|
||||||
if (dictinsert(d, "__builtins__", getbuiltindict()))
|
if (dictinsert(d, "__builtins__", getbuiltins()))
|
||||||
fatal("can't add __builtins__ to __main__");
|
fatal("can't add __builtins__ to __main__");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue