From 24e1ce25d14cbb61499d9b1229f1f35e9d3408f5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 25 Feb 2014 16:49:14 +1100 Subject: Use string escaping when renaming custom properties --- release/scripts/startup/bl_operators/wm.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'release') diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index a6060c63448..5dadf77ce92 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -1081,12 +1081,12 @@ class WM_OT_properties_edit(Operator): prop_type_old = type(item[prop_old]) rna_idprop_ui_prop_clear(item, prop_old) - exec_str = "del item['%s']" % prop_old + exec_str = "del item[%r]" % prop_old # print(exec_str) exec(exec_str) # Reassign - exec_str = "item['%s'] = %s" % (prop, repr(value_eval)) + exec_str = "item[%r] = %s" % (prop, repr(value_eval)) # print(exec_str) exec(exec_str) self._last_prop[:] = [prop] @@ -1103,7 +1103,7 @@ class WM_OT_properties_edit(Operator): # If we have changed the type of the property, update its potential anim curves! if prop_type_old != prop_type: - data_path = '["%s"]' % prop + data_path = '["%s"]' % bpy.utils.escape_identifier(prop) done = set() def _update(fcurves): @@ -1114,9 +1114,9 @@ class WM_OT_properties_edit(Operator): def _update_strips(strips): for st in strips: - if st.type in {'CLIP'} and st.action: + if st.type == 'CLIP' and st.action: _update(st.action.fcurves) - elif st.type in {'META'}: + elif st.type == 'META': _update_strips(st.strips) adt = getattr(item, "animation_data", None) -- cgit v1.2.3