summaryrefslogtreecommitdiffstats
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
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 e59458e..c387c62 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 *