quiet harmless py resource warning - file opened but not closed.

This commit is contained in:
Campbell Barton 2011-08-08 09:01:09 +00:00
parent cc0ec3aa33
commit 24acf58fc4
2 changed files with 3 additions and 1 deletions

@ -545,9 +545,11 @@ class WM_OT_keyconfig_import(bpy.types.Operator):
if not self.filepath:
raise Exception("Filepath not set")
# simply check we can open
f = open(self.filepath, "r")
if not f:
raise Exception("Could not open file")
f.close()
config_name = basename(self.filepath)

@ -277,7 +277,7 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event)
case UI_ID_ALONE:
if(id) {
const int do_scene_obj= (GS(id->name) == ID_OB) &&
(template->ptr.type == &RNA_SceneObjects);
(template->ptr.type == &RNA_SceneObjects);
/* make copy */
if(do_scene_obj) {