comparison Python/pythonrun.c @ 41017:1080de49c81e 2.5

Bug #1674503: close the file opened by execfile() in an error condition. (backport)
author Georg Brandl <georg@python.org>
date Tue, 06 Mar 2007 12:16:52 +0000
parents da30a26dfeb3
children 66f265ac4ec4
comparison
equal deleted inserted replaced
41016:b6dcb7783385 41017:1080de49c81e
1242 if (arena == NULL) 1242 if (arena == NULL)
1243 return NULL; 1243 return NULL;
1244 1244
1245 mod = PyParser_ASTFromFile(fp, filename, start, 0, 0, 1245 mod = PyParser_ASTFromFile(fp, filename, start, 0, 0,
1246 flags, NULL, arena); 1246 flags, NULL, arena);
1247 if (closeit)
1248 fclose(fp);
1247 if (mod == NULL) { 1249 if (mod == NULL) {
1248 PyArena_Free(arena); 1250 PyArena_Free(arena);
1249 return NULL; 1251 return NULL;
1250 } 1252 }
1251 if (closeit)
1252 fclose(fp);
1253 ret = run_mod(mod, filename, globals, locals, flags, arena); 1253 ret = run_mod(mod, filename, globals, locals, flags, arena);
1254 PyArena_Free(arena); 1254 PyArena_Free(arena);
1255 return ret; 1255 return ret;
1256 } 1256 }
1257 1257