diff Python/pythonrun.c @ 1262:f820e6917f07 legacy-trunk

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.
author Guido van Rossum <guido@python.org>
date Tue, 30 Mar 1993 13:18:41 +0000
parents 1cabc2b6c970
children 65a1e4e9cd54
line wrap: on
line diff
--- a/Python/pythonrun.c	Mon Mar 29 11:39:45 1993 +0000
+++ b/Python/pythonrun.c	Tue Mar 30 13:18:41 1993 +0000
@@ -304,16 +304,23 @@
 	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 *