avoid using exec()
authorCampbell Barton <ideasman42@gmail.com>
Wed, 14 Apr 2010 07:58:33 +0000 (07:58 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 14 Apr 2010 07:58:33 +0000 (07:58 +0000)
release/scripts/op/presets.py

index 3272bdfb8ad2435ce01eec6c54951667dd59403a..75766995a05140eb953adb7e595e3fb26b3df381 100644 (file)
@@ -85,7 +85,9 @@ class ExecutePreset(bpy.types.Operator):
 
     def execute(self, context):
         # change the menu title to the most recently chosen option
-        exec("bpy.types.%s.bl_label=\'%s\'" % (self.properties.menu_idname, self.properties.preset_name))
+        preset_class = getattr(bpy.types, self.properties.menu_idname)
+        preset_class.bl_label = self.properties.preset_name
+        print(10)
  
         # execute the preset using script.python_file_run
         bpy.ops.script.python_file_run(path=self.properties.path)