quiet harmless py resource warning - file opened but not closed.
authorCampbell Barton <ideasman42@gmail.com>
Mon, 8 Aug 2011 09:01:09 +0000 (09:01 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 8 Aug 2011 09:01:09 +0000 (09:01 +0000)
release/scripts/startup/bl_ui/space_userpref_keymap.py
source/blender/editors/interface/interface_templates.c

index 5658cc96281084e605ef32f9b2b60453947fdbc6..9736ea5bc22543734038d454dfaaa49aa17ad6d8 100644 (file)
@@ -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)
 
index 35125d1483e1798512f90f644f6a73b8f2a2971f..305a4a8b3d6a087e88247a7c08f136548a12ad63 100644 (file)
@@ -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) {