Kaydet (Commit) 15e138a0 authored tarafından Georg Brandl's avatar Georg Brandl

Bug #1674503: close the file opened by execfile() in an error condition.

 (backport)
üst 8da6f1b6
......@@ -12,6 +12,8 @@ What's New in Python 2.5.1c1?
Core and builtins
-----------------
- Bug #1674503: close the file opened by execfile() in an error condition.
- Patch #1674228: when assigning a slice (old-style), check for the
sq_ass_slice instead of the sq_slice slot.
......
......@@ -1244,12 +1244,12 @@ PyRun_FileExFlags(FILE *fp, const char *filename, int start, PyObject *globals,
mod = PyParser_ASTFromFile(fp, filename, start, 0, 0,
flags, NULL, arena);
if (closeit)
fclose(fp);
if (mod == NULL) {
PyArena_Free(arena);
return NULL;
}
if (closeit)
fclose(fp);
ret = run_mod(mod, filename, globals, locals, flags, arena);
PyArena_Free(arena);
return ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment