comparison Python/pythonrun.c @ 41018:5c08e6460dc5 legacy-trunk

Bug #1674503: close the file opened by execfile() in an error condition.
author Georg Brandl <georg@python.org>
date Tue, 06 Mar 2007 12:17:50 +0000
parents 86ab2f20a333
children 728c60e85efa
comparison
equal deleted inserted replaced
41015:5c196aa6ecf4 41018:5c08e6460dc5
1249 if (arena == NULL) 1249 if (arena == NULL)
1250 return NULL; 1250 return NULL;
1251 1251
1252 mod = PyParser_ASTFromFile(fp, filename, start, 0, 0, 1252 mod = PyParser_ASTFromFile(fp, filename, start, 0, 0,
1253 flags, NULL, arena); 1253 flags, NULL, arena);
1254 if (closeit)
1255 fclose(fp);
1254 if (mod == NULL) { 1256 if (mod == NULL) {
1255 PyArena_Free(arena); 1257 PyArena_Free(arena);
1256 return NULL; 1258 return NULL;
1257 } 1259 }
1258 if (closeit)
1259 fclose(fp);
1260 ret = run_mod(mod, filename, globals, locals, flags, arena); 1260 ret = run_mod(mod, filename, globals, locals, flags, arena);
1261 PyArena_Free(arena); 1261 PyArena_Free(arena);
1262 return ret; 1262 return ret;
1263 } 1263 }
1264 1264