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
commit3873f1e038949ace69247ae135948a40aead9022 (patch)
tree674feb40cdd451a756a56c60928aced4f9dd943b /Python/pythonrun.c
parent58f83893d2a6424253f1e3714db2357044981fea (diff)
downloadcpython-3873f1e038949ace69247ae135948a40aead9022.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 *