From ff4949eeee7f86117d4a69599777ff5564315e39 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Wed, 5 Aug 1992 19:58:53 +0000 Subject: * Makefile: cosmetics * socketmodule.c: get rid of makepair(); fix makesocketaddr to fix broken recvfrom() * socketmodule: get rid of getStrarg() * ceval.h: move eval_code() to new file eval.h, so compile.h is no longer needed. * ceval.c: move thread comments to ceval.h; always make save/restore thread functions available (for dynloaded modules) * cdmodule.c, listobject.c: don't include compile.h * flmodule.c: include ceval.h * import.c: include eval.h instead of ceval.h * cgen.py: add forground(); noport(); winopen(""); to initgl(). * bltinmodule.c, socketmodule.c, fileobject.c, posixmodule.c, selectmodule.c: adapt to threads (add BGN/END SAVE macros) * stdwinmodule.c: adapt to threads and use a special stdwin lock. * pythonmain.c: don't include getpythonpath(). * pythonrun.c: use BGN/END SAVE instead of direct calls; also more BGN/END SAVE calls etc. * thread.c: bigger stack size for sun; change exit() to _exit() * threadmodule.c: use BGN/END SAVE macros where possible * timemodule.c: adapt better to threads; use BGN/END SAVE; add longsleep internal function if BSD_TIME; cosmetics --- Python/bltinmodule.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Python/bltinmodule.c') diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index d6ae46f59a..ca5043d764 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -33,7 +33,6 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "bltinmodule.h" #include "import.h" #include "pythonrun.h" -#include "compile.h" /* For ceval.h */ #include "ceval.h" #include "modsupport.h" @@ -218,13 +217,17 @@ builtin_execfile(self, v) "execfile arguments must be filename[,dict[,dict]]"); return NULL; } + BGN_SAVE fp = fopen(getstringvalue(str), "r"); + END_SAVE if (fp == NULL) { err_setstr(IOError, "execfile cannot open the file argument"); return NULL; } w = run_file(fp, getstringvalue(str), file_input, globals, locals); + BGN_SAVE fclose(fp); + END_SAVE return w; } @@ -324,9 +327,11 @@ builtin_input(self, v) } m = add_module("__main__"); d = getmoduledict(m); + BGN_SAVE while ((c = getc(in)) != EOF && (c == ' ' || c == '\t')) ; ungetc(c, in); + END_SAVE return run_file(in, "", expr_input, d, d); } -- cgit v1.2.1