summaryrefslogtreecommitdiff
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1993-03-30 13:18:41 +0000
committerGuido van Rossum <guido@python.org>1993-03-30 13:18:41 +0000
commit8b17d6bd89cd79820c76bd88bc064e44fc03a1bd (patch)
tree3d8fd0cc9e8401bdd79980b52db03bfe3b2431e8 /Python/pythonrun.c
parent0023078a0b751260acdee7be0b029335f7efe888 (diff)
downloadcpython-git-8b17d6bd89cd79820c76bd88bc064e44fc03a1bd.tar.gz
Changes to speed up local variables enormously, by avoiding dictionary
lookup (opcode.h, ceval.[ch], compile.c, frameobject.[ch], pythonrun.c, import.c). The .pyc MAGIC number is changed again. Added get_menu_text to flmodule.
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r--Python/pythonrun.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index e59458e587..c387c62996 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -304,16 +304,23 @@ run_node(n, filename, globals, locals)
char *filename;
/*dict*/object *globals, *locals;
{
+ object *res;
+ int needmerge = 0;
if (globals == NULL) {
globals = getglobals();
- if (locals == NULL)
+ if (locals == NULL) {
locals = getlocals();
+ needmerge = 1;
+ }
}
else {
if (locals == NULL)
locals = globals;
}
- return eval_node(n, filename, globals, locals);
+ res = eval_node(n, filename, globals, locals);
+ if (needmerge)
+ mergelocals();
+ return res;
}
object *